Title: Detecting wrong image size
Last modified: August 20, 2016

---

# Detecting wrong image size

 *  [Clifford Paulick](https://wordpress.org/support/users/cliffpaulick/)
 * (@cliffpaulick)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/detecting-wrong-image-size/)
 * 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](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](http://cl.ly/image/0m3x0F3Z2X3x)
 * My settings: [http://cl.ly/image/3U3c0g0f2f2y](http://cl.ly/image/3U3c0g0f2f2y)
 * The file detected as too large in size: [http://cl.ly/image/341Z210Z2D1X](http://cl.ly/image/341Z210Z2D1X)
 * In summary:
    -file is already 1333×2000 but EXIF image size says 5184×3456 -this
   plugin detects it as 5184×3456 even though it’s truly only 1333×2000 on the server
 * Hope these details help figure out what’s wrong. Thank you.
 * [http://wordpress.org/extend/plugins/imsanity/](http://wordpress.org/extend/plugins/imsanity/)

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

 *  [Jason](https://wordpress.org/support/users/verysimple/)
 * (@verysimple)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/detecting-wrong-image-size/#post-3460231)
 * 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)
 *  [Jason](https://wordpress.org/support/users/verysimple/)
 * (@verysimple)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/detecting-wrong-image-size/#post-3460232)
 * Here is the query you can run to see the metadata for your files:
 *     ```
       select
       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'
       ```
   
 *  Thread Starter [Clifford Paulick](https://wordpress.org/support/users/cliffpaulick/)
 * (@cliffpaulick)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/detecting-wrong-image-size/#post-3460236)
 * 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:"";}}`

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

The topic ‘Detecting wrong image size’ is closed to new replies.

 * ![](https://ps.w.org/imsanity/assets/icon.svg?rev=2420360)
 * [Imsanity](https://wordpress.org/plugins/imsanity/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/imsanity/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/imsanity/)
 * [Active Topics](https://wordpress.org/support/plugin/imsanity/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/imsanity/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/imsanity/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Clifford Paulick](https://wordpress.org/support/users/cliffpaulick/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/detecting-wrong-image-size/#post-3460236)
 * Status: not resolved