Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter simo78

    (@simo78)

    Ok, tested the same scenario with 2.2.5 and cannot reproduce the issue anymore. file-1024x682.jpg is not altered and only the full-size image is changed (now identical with file-1024x682.jpg).

    Great, thanks a lot! Marking this thread as resolved now.

    Thread Starter simo78

    (@simo78)

    Ok, great. If you need someone to verify that the patch is working, I’ll be glad to help.

    Thread Starter simo78

    (@simo78)

    Yes, I confirm that this seems to affect only bulk resizing. Sorry if I didn’t make it clear in the very beginning!

    Thanks for your effort, it’s a very nice plugin. I get your point about not patching the issue.

    This sounds like the same issue I am having. I have a 1200 x 800 image and a fresh WordPress 3.8 installation with only Imsanity plugin installed. When uploading image files, the medium size thumbnail file becomes 300 x 199 pixels. When the plugin is deactivated and files with same size are uploaded, the medium size thumbnail files are created at 300 x 200 pixels.

    Looking at wp-includes/media.php, the wp_constrain_dimensions seems to contain also this:

    // Sometimes, due to rounding, we'll end up with a result like this: 465x700 in a 177x177 box is 117x176... a pixel short
            // We also have issues with recursive calls resulting in an ever-changing result. Constraining to the result of a constraint should yield the original result.
            // Thus we look for dimensions that are one pixel shy of the max value and bump them up
            if ( $did_width && $w == $max_width - 1 )
                    $w = $max_width; // Round it up
            if ( $did_height && $h == $max_height - 1 )
                    $h = $max_height; // Round it up

    I wonder if for some reason this piece of code is not executed when called by Imsanity?

    Thread Starter simo78

    (@simo78)

    Hi Jason,

    Thanks for your reply. It is very easy to reproduce this issue with a fresh WordPress 3.8 installation. All that is needed is the Imsanity plugin and a suitable image file. An image file of 1200 x 800 pixels will reproduce the issue with default settings of both WordPress and Imsanity.

    1. Install WordPress 3.8. Setup database connection parameters to wp-config.php and run wp-admin/install.php. No other config is needed.

    2. Media > Add new. Upload the image file with 1200 x 800 dimensions.

    Table wp_postmeta now contains an entry with:

    wp_attachment_metadata | a:5:{s:5:"width";i:1200;s:6:"height";i:800;s:4:"file";s:20:"2014/01/MK221684.jpg";s:5:"sizes";a:5:{s:9:"thumbnail";a:4:{s:4:"file";s:20:"MK221684-150x150.jpg";s:5:"width";i:150;s:6:"height";i:150;s:9:"mime-type";s:10:"image/jpeg";}s:6:"medium";a:4:{s:4:"file";s:20:"MK221684-300x200.jpg";s:5:"width";i:300;s:6:"height";i:200;s:9:"mime-type";s:10:"image/jpeg";}s:5:"large";a:4:{s:4:"file";s:21:"MK221684-1024x682.jpg";s:5:"width";i:1024;s:6:"height";i:682;s:9:"mime-type";s:10:"image/jpeg";}s:14:"post-thumbnail";a:4:{s:4:"file";s:20:"MK221684-672x372.jpg";s:5:"width";i:672;s:6:"height";i:372;s:9:"mime-type";s:10:"image/jpeg";}s:25:"twentyfourteen-full-width";a:4:{s:4:"file";s:21:"MK221684-1038x576.jpg";s:5:"width";i:1038;s:6:"height";i:576;s:9:"mime-type";s:10:"image/jpeg";}}s:10:"image_meta";a:10:{s:8:"aperture";d:5;s:6:"credit";s:0:"";s:6:"camera";s:22:"Canon EOS-1D Mark II N";s:7:"caption";s:0:"";s:17:"created_timestamp";i:1371812123;s:9:"copyright";s:0:"";s:12:"focal_length";s:3:"200";s:3:"iso";s:3:"500";s:13:"shutter_speed";s:6:"0.0008";s:5:"title";s:0:"";}}

    Uploads directory should now contain the following files (see below), of which MK221684.JPG is the original full-size image with 1200 x 800 dimensions, size 480095 bytes.

    141162 Jan  6 16:27 MK221684-1024x682.jpg
    129805 Jan  6 16:27 MK221684-1038x576.jpg
    22824 Jan  6 16:27 MK221684-150x150.jpg
    31861 Jan  6 16:27 MK221684-300x200.jpg
    70996 Jan  6 16:27 MK221684-672x372.jpg
    480095 Jan  6 16:27 MK221684.jpg

    All is fine now.

    3. Install Imsanity. Use default settings, where 1024 x 1024 pixels is the crop limit for all use cases.

    4. Run Bulk Resize Images.

    The outcome is such that Uploads directory now contains the following files:

    129805 Jan  6 16:27 MK221684-1038x576.jpg
    22824 Jan  6 16:27 MK221684-150x150.jpg
    31861 Jan  6 16:27 MK221684-300x200.jpg
    70996 Jan  6 16:27 MK221684-672x372.jpg
    141162 Jan  6 16:35 MK221684.jpg

    What seems to have happened is that full-size version file MK221684.jpg got overwritten by MK221684-1024×682.jpg (probably by unlink($oldPath); rename($newPath, $oldPath); within ajax.php). No file with name MK221684-1024×682.jpg exists anymore.

    Table wp_postmeta remains unchanged, and is still having a serialized entry for MK221684-1024×682.jpg, the related file of which is now missing.

    Hope this helps!

Viewing 5 replies - 1 through 5 (of 5 total)