bbPress Plugin Browser »

bbPress Attachments (0.2.9)

Download

Version: 0.2.9

Last Updated: 2011-11-28

Requires bbPress Version: 0.9 or higher

Compatible up to: 0.9

Author Homepage »

Plugin Homepage »

Donate to this plugin »

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(19)

Your Rating

Author: _ck_


  1. __ck__, I know I've got the prefix correct, because bb_attachments will display attached images inline, and will allow me to download them. Is there perhaps something else I'm missing? At any rate, as the link above was meant to demonstrate, even attachments posted with the plugin (and not migrated via the script) don't behave correctly when clicked on.

    (And we're abandoning it precisely because it's not exactly working…the problem with SMF is that so-called "plugins" are often just hacky patches, and after too many, the codebase begins to degrade. Things are breaking on us left and right…the install is literally crumbling in our hands. We want something easier to admin. I'm currently putting together a proof-of-concept site to demonstrate that we could eventually migrate to bbPress with minimal disruption to our users' experience.)

    Posted: 2 years ago #
  2. I don't think you realize that any non-inline attachment, image or otherwise will not display standalone. It will always prompt for download. That is not a bug, it's design to prevent hotlinking.

    I guess I could add code to detect if it's an image and change the header but I'm fairly burnt out on bbPress right now and mostly taking a break from it for the summer. Maybe I'll look at it over the weekend.

    Posted: 2 years ago #
  3. Indivio

    Member

    This works great for small files, but it is failing for large files. I reset the file size limits to 10MB, but even 4MB files are not uploading.

    Thanks in advance for your help!

    Posted: 2 years ago #
  4. johnhiler

    Member

    Hey Indivio - I think php has some sort of limit on file size uploads... you can change the relevant settings in your php.ini file:
    http://drupal.org/node/109994

    Posted: 2 years ago #
  5. Thanks for this plugin _ck_, I will be testing shortly. I need an easy way for members to upload photos, this may do the trick, because i still want my forums to remain light and only to load what they want.

    Any progress on the thumbnail feature?

    Posted: 2 years ago #
  6. Does this plugin work with bbpress1.0rc? When testing on my local XAMPP, the interface for uploads show up, but when I hit the 'upload' button, it just posts without any attachment. I already changed the path settings, but nothing ever happens.

    Posted: 2 years ago #
  7. None of my plugins officially are supported on 1.0 rc and won't be until the end of the year.

    Posted: 2 years ago #
  8. Is there ability to adjust the inline image quality? I couldn't find any settings or an unsharpmask routine inside the plugin files.

    Posted: 2 years ago #
  9. aberrantphoto

    Member

    for anybody that was having problems with this database error:

    bbPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE status=0 AND user_id>0 AND size>0 AND post_id IN (SELECT post_id FROM bb_p' at line 1]
    SELECT count(*) as count FROM WHERE status=0 AND user_id>0 AND size>0 AND post_id IN (SELECT post_id FROM bb_posts WHERE post_status=0 AND topic_id=13)
    1

    i found the solution here after an hour or so of research (argh!): http://bbpress.org/forums/topic/error-when-deleting-a-topic?replies=5#post-28504

    even though this was somewhat unrelated of issue. i tried the whole de-activating and activating thing, running the mysql query in phpadmin, reinstalling, etc. and none of that worked except for entering that one line of code as noted by the link above. hope this eliminates some headache for others.

    Posted: 2 years ago #
  10. I think the fix for the recount with the global has been fixed for awhile now, you must have been running an old version?

    Yup it was fixed April 30th
    http://plugins-dev.bbpress.org/changeset/1910

    Posted: 2 years ago #
  11. Hi CK -

    I'm testing the function imagejpeg (and imagepng for PNG files) to increase the quality of the reduced inline images from a default quality of 75 to 100.

    I've added the following imagejpeg code to test:

    <br />
    	imagecopyresampled($new, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height);<br />
    	imagejpeg($new, $filename, 100);<br />
    	$save($new, $output);<br />

    The image quality is increased greatly, however I have to reload the page to see the better image. It's definitely not a cache issue. It's pulling the lower quality image first and then showing the higher quality version after browser refresh.

    I'm unclear what the $save($new, $output) function does, and that may be the culprit.

    Any help would be great! Thanks!

    Posted: 2 years ago #
  12. 100 is a waste of space in jpeg - anything above 92 or so cannot be detected by most untrained eyes

    I never did add an unsharp mask, though I do have the routine running for another plugin that I could eventually put into the attachments plugin.

    You could include this routine yourself if you know how to code in php:
    http://vikjavev.no/computing/ump.php

    ps. unlike jpeg there is no quality loss in PNG when saved, you are probably just suffering from a lack of unsharp mask

    Posted: 2 years ago #
  13. I tried the unsharpmask method you just suggested. Added the USM function to bb-attachments.php and played with a bunch of different USM settings. They all provide a "sharper" image, but the JPG artifacts are still there... just "sharper" than before but not cleaner.

    I don't get any JPG artifacts using imagejpeg set to 100 or even 92. Any tips?

    imagecopyresampled($new, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
    UnsharpMask($new, 80, 0.5, 3);
    $save($new, $output);

    Posted: 2 years ago #
  14. Just make sure you are not unsharpmasking the jpeg itself, you want to first resample the image to downsize it, then unsharp it, then jpeg it and save it.

    show me more of that function you have changed

    Posted: 2 years ago #
  15. The first thing I did was add function UnsharpMask (from your link above) to bb-attachments.php. Then I added one new line after imagecopyresampled and before $save($new, $output); to call the function.

    $output=$filename.$suffix;
    if (!file_exists($output)) {
    $new= imagecreatetruecolor($new_width, $new_height);

    imagecopyresampled($new, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
    UnsharpMask($new, 80, 0.5, 3);
    $save($new, $output);
    imagedestroy($new);
    }
    imagedestroy($img);

    What I get is an image that's sharper, but still contains JPEG artifacts. Am I doing something wrong?

    Posted: 2 years ago #
  16. You are doing it wrong, unsharpmask is doing nothing the way you have it.

    $new=UnsharpMask($new, 80, 0.5, 3);
    Posted: 2 years ago #
  17. For sure it's working. Take a look at the examples:

    Default
    USM
    JPEG at 92
    Original

    I've tried it your way and it produces the same results.

    Posted: 2 years ago #
  18. see below

    Posted: 2 years ago #
  19. I was probably doing it wrong, but I modified it as you've said and it still produces the same USM results. Sharper image with sharper artifacts:

    Here's the new USM file:

    USM (using $new=UnsharpMask($new, 80, 0.5, 3); vs. UnsharpMask($new, 80, 0.5, 3);)

    Here's the code:
    $output=$filename.$suffix;
    if (!file_exists($output)) {
    $new= imagecreatetruecolor($new_width, $new_height);

    imagecopyresampled($new, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
    $new=UnsharpMask($new, 80, 0.5, 3);
    $save($new, $output);
    imagedestroy($new);
    }
    imagedestroy($img);

    Posted: 2 years ago #
  20. Weird. Somehow it's modifying it by reference, oh well.
    I'm not sure what you want at this point, you are at the limits of the technology unsharp+jpeg, just fine tune the settings that you want and you're done.

    Basically you are going to have to tinker alot with the unsharp settings, and you will discover that unfortunately there is no one setting that is best for all pictures. I would essentially unsharp as little as possible to prevent pixelation but to get things back in focus.

    Posted: 2 years ago #

RSS feed for this topic

Add a Comment »

You must log in to post.