Photopress 0.8.5

This version is still mostly bug fixes, so I’m sticking with 0.8.x. It should work well with both WordPress 2.0 and 1.5.2.

New features and fixes:

  • Fixed a bad bug in the duplicate renaming function. Also added a maintenance function to clean up filenames if you’ve uploaded a few with bad names.
  • Fixed the bug Nonni found where ampersands in category names messed things up. Photopress should now handle ampersands in category names just fine.
  • Fixed a few problems with permalinks. They work differently in WP 2.0, so I’m handling it with some version-specific code, which sucks.

Download Photopress 0.8.5: photopress.zip OR photopress.tar.gz

As usual, let me know what’s broken or needs work. Thanks again for all the bug reports and feature ideas!

20 Responses to “Photopress 0.8.5”

  1. SHRIKEE Says:

    For me everything works !!!

    WP 2.0 / PP 0.8.5

  2. pedqnk Says:

    The permalinks is all right, all works for me too.

    But I have a problem, when I active the Photopress plugin dissapear the image upload by defect of WordPress 2.0, can I have the two things simultaneously?

  3. pedqnk Says:

    Sorry, I have problems with Permalinks when there are more than one pages of photos, I only can see the first page.

  4. Enviro Says:

    the insert photo at write page still isn’t working for me after the upgrade.. any solutions?

  5. kamenotaku Says:

    Please note that in line 120 for the photopress.php file there is a mistake in the XHTML formatting.
    You incorrect put
    $random_alt_text . ‘” />’ . $random_thumb .
    which was followed by a close anchor tag

    When you should have put
    $random_alt_text . ‘” >’ . $random_thumb .

    I haven’t had more time to find other bugs yet, but otherwise GREAT job on the 2.0 update -and fast too!

  6. Jedi Rory Says:

    I”m getting the following error whenever I try to use the upload option:

    tinyMCE object reference not found from popup

    It’s annoying as hell….I downloaded the latest version of PhotoPress and that didn’t seem to do anything for me.

  7. SHRIKEE Says:

    Indeed, permalinks do not work for multiple pages :(

  8. Britta Says:

    This release works better with my WP2 than the previous (Dec 28). Previously, clicking on the thumbnail/image in the blog entry would not take you to the album entry, but simply reload the blog page.
    Now, clicking on the thumbnail/image, I do get to the album … yay! But - the album page has no styling (stylesheet not applied). :(

    Any idea? What should I check?

  9. sistogxp Says:

    works perfect!!

  10. SHRIKEE Says:

    try reinstalling your PP release by deleteing the old files and uploading them again (not overwrite the old files).

    It should be plug and play.

  11. Roge Says:

    Have change thumbnails size to larger value AND made them “square” -> Mass resize doesn’t resize them. Says 0 images 0 thumbnails.

  12. Britta Says:

    Thanks, Shrikee - but I had already installed a fresh, latest copy of PP.
    Isaac was so kind to email me, suggesting that I probably need to edit the two album files; which is what I’ll look into.

  13. Britta Says:

    Update: I have now identified the problem, and it’s unfortunately the permalinks option.

  14. SHRIKEE Says:

    Hope everything works now for you Britta.

    I noticed Isaac does quite a big deal of personal support :) A vert nice touch if you ask me! Not many do that…

  15. Roge Says:

    Req:

    Update photo file. (Overwrite the old one and take all parameters of old one: name, description etc…)

    IF the new file has different name THEN rename it in to the old file name.

    I think update functionality should be on photo edit screen + during new file upload (if same name then optional OVERWRITE or RENAME)

    BTW. switched to WP 2.0 Everything works fine!

  16. Roge Says:

    My fixes:

    pp_mass_resize() function works not with ORIGINAL files but with resized. Actually it will be useful to start work FROM originals. My code is:

    — First I have fix the pp_folder_contents() and add a new parameter $include_originals=true So the final function is:

    function pp_folder_contents($include_originals=true) {
    global $pp_options;
    $allowedtypes = trim(strtolower($pp_options['allowedtypes']));
    $allowedtypes = preg_replace(”/ /”,”|”,$allowedtypes);
    $fileglob = ‘@\.(’ . $allowedtypes . ‘)$@i’;
    $handle = opendir($pp_options['photospath']);
    $list_array = array();
    while (false !== ($folder_contents = readdir($handle))) {
    $image_name = substr($folder_contents, strlen($pp_options['thumbprefix']));
    $is_original = strpos($pp_options['origprefix'], $image_name);
    if (($include_originals || !$is_original) && (preg_match($fileglob, $folder_contents)) && (strstr($folder_contents, $pp_options['thumbprefix'])) && is_file($pp_options['photospath'] . ‘/’ . $image_name)) { // make sure both thumb and regular image are there
    $list_array[] = $image_name;
    }
    }
    @closedir($pp_options['photospath']);
    if (count($list_array) > 1) {
    sort($list_array);
    }
    if (count($list_array) > 0) {
    return $list_array;
    } else {
    return FALSE;
    }
    }

    There are 2 new strings in fuction:

    $is_original = strpos($pp_options['origprefix'], $image_name);
    if (($include_originals || !$is_original) && (preg_match($fileglob, $folder_contents)) && (strstr($folder_contents, $pp_options['thumbprefix'])) && is_file($pp_options['photospath'] . ‘/’ . $image_name)) {

    — Second. pp_mass_resize() Gets files from folder WITHOUT originals. THEN takes originals and copies them to resized ONLY if resized need to be REresized ( thumbs can be done from resized). And only then resizes the files. It also checks IF originals option is enabled in options. IF not enabled then works as usual. Final:

    function pp_mass_resize() {
    global $pp_options;
    $images = pp_folder_contents(false);
    $thumbsdone = 0;
    $imagesdone = 0;
    foreach ((array)$images as $image) {
    $pathtoorig = $pp_options['photospath'] . ‘/’ . $pp_options['origprefix'] . $image;
    $pathtoimage = $pp_options['photospath'] . ‘/’ . $image;
    $pathtothumb = $pp_options['photospath'] . ‘/’ . $pp_options['thumbprefix'] . $image;

    $imginfo = getimagesize($pathtoimage);
    $thumbinfo = getimagesize($pathtothumb);

    if ($imginfo && $thumbinfo) {
    if (($imginfo[0] != $pp_options['maxsize']) || ($imginfo[1] != $pp_options['maxsize'])) {
    if ($pp_options['originals'] == ‘1′ && !copy($pathtoorig, $pathtoimage)) { echo “failed to copy $pathtoorig TO $pathtoimage\n”;}
    }

    if (($imginfo[0] != $pp_options['maxsize']) || ($imginfo[1] != $pp_options['maxsize'])) {
    if (pp_resize($pathtoimage, $pp_options['maxsize'], 0, ”, 0)) {
    $imagesdone++;
    }
    }
    if (($thumbinfo[0] != $pp_options['thumbsize']) || ($thumbinfo[1] != $pp_options['thumbsize'])) {
    if (pp_resize($pathtoimage, $pp_options['thumbsize'], $pp_options['thumbsize'], $pp_options['thumbprefix'], 1)) {
    $thumbsdone++;
    }
    }
    }
    }
    return array($imagesdone,$thumbsdone);
    }

  17. Roge Says:

    Another useful addon for edit image page - link to EDIT posts which use the image. Addon for pp_album_management():

    echo ” . __(’Posts with this image:’,'photopress’) . ‘
    ‘;
    while ( have_posts() ) : the_post();
    echo ‘‘;
    the_title();
    echo ‘
    | ‘;
    edit_post_link();
    echo ”;
    endwhile;
    echo ”;

  18. Roge Says:

    Just found. Photopress disables standart file upload panel in WP 2.0 Write. Why?

  19. nekkarcity Says:

    @Roge
    WP 2 changed the button API a little bit. Based on Owen Winkler button snap class it’s easy to fix that.

    @Jedi Rory
    tinyMCE object reference not found from popup

    On the popup.php

    if (get_user_option(’rich_editing’) == ‘true’) {
    include_once(ABSPATH . ‘wp-includes/js/tinymce/tiny_mce_popup.js’);
    }

    The Problem: the if – it’s better to add an extra option (variable) for the upload click.

  20. Roge Says:

    nekkarcity: already fixed But I’m really sure “File Uploader” on/off should be optional. Many users might be confused.

Leave a Reply