Detecting wrong image size (4 posts)

  1. Clifford Paulick
    Posted 3 years ago #

    Best I can guess, this plugin looks at the EXIF data, not the actual image dimensions of the file on the server. Maybe it's something else, but here's one issue I noticed on all/most of my images:

    Details of the actual image file (never processed by Imsanity plugin): http://regex.info/exif.cgi?dummy=on&imgurl=http%3A%2F%2Ftourkick.com%2Fwp-content%2Fuploads%2F2012%2F12%2Fkitchen-IMG_5804.jpg

    The file in the Media Library: http://cl.ly/image/0m3x0F3Z2X3x

    My settings: http://cl.ly/image/3U3c0g0f2f2y

    The file detected as too large in size: http://cl.ly/image/341Z210Z2D1X

    In summary:
    -file is already 1333x2000 but EXIF image size says 5184×3456
    -this plugin detects it as 5184×3456 even though it's truly only 1333x2000 on the server

    Hope these details help figure out what's wrong. Thank you.


  2. Jason
    Plugin Author

    Posted 3 years ago #

    Imsanity uses the wordpress meta-data which is found in the the "posts" table - you'll find a row in there for each image upload with a type of "attachment". it has a meta data field where WordPress stores all of the various sizes (original, thum, medium, large). Imsanity uses this WordPress metadata - it doesn't look at the file itself.

    So, it could be that WordPress is reading the EXIF data (or read the data at one point) and stored the dimensions, which are now out of date.

    Imsanity does update the WordPress metadata after it resizes the image (at least it is supposed to)

  3. Jason
    Plugin Author

    Posted 3 years ago #

    Here is the query you can run to see the metadata for your files:

    wp_posts.ID as ID,
    wp_posts.guid as guid,
    wp_postmeta.meta_value as file_meta
    from wp_posts
    inner join wp_postmeta on wp_posts.ID = wp_postmeta.post_id and wp_postmeta.meta_key = '_wp_attachment_metadata'
    where wp_posts.post_type = 'attachment'
    and wp_posts.post_mime_type like 'image%'
    and wp_posts.post_mime_type != 'image/bmp'
  4. Clifford Paulick
    Posted 3 years ago #

    Thanks for that. Here is the file_meta for that image:

    a:6:{s:5:"width";i:2000;s:6:"height";i:1333;s:14:"hwstring_small";s:23:"height='85' width='128'";s:4:"file";s:28:"2012/12/kitchen-IMG_5804.jpg";s:5:"sizes";a:4:{s:9:"thumbnail";a:3:{s:4:"file";s:28:"kitchen-IMG_5804-150x100.jpg";s:5:"width";s:3:"150";s:6:"height";s:3:"100";}s:6:"medium";a:3:{s:4:"file";s:28:"kitchen-IMG_5804-600x400.jpg";s:5:"width";s:3:"600";s:6:"height";s:3:"400";}s:5:"large";a:3:{s:4:"file";s:30:"kitchen-IMG_5804-2000x1333.jpg";s:5:"width";s:4:"2000";s:6:"height";s:4:"1333";}s:20:"repository_logo_size";a:3:{s:4:"file";s:28:"kitchen-IMG_5804-285x115.jpg";s:5:"width";s:3:"285";s:6:"height";s:3:"115";}}s:10:"image_meta";a:10:{s:8:"aperture";s:1:"0";s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";s:1:"0";s:9:"copyright";s:0:"";s:12:"focal_length";s:1:"0";s:3:"iso";s:1:"0";s:13:"shutter_speed";s:1:"0";s:5:"title";s:0:"";}}

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Imsanity
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.