mlowery Posted August 2, 2008 Share Posted August 2, 2008 (edited) I've inherited the family digital photo album of JPG photos. There are tons of dupes saved at varying sizes and JPG compressions. I'd like to write a quick script to group the images by size and JPG quality so I can review and purge them more easily. I can get the dimensions of an image through the GDI+ UDF. How can I read the JPG compression / quality from the saved image? (EXIF data is no help; whatever editing tool was used to resize the files wiped it out.) Edited August 2, 2008 by mlowery Link to comment Share on other sites More sharing options...
weaponx Posted August 2, 2008 Share Posted August 2, 2008 This could be tricky, it doesn't look like GDI+ offers full functionality for your needs:http://www.eggheadcafe.com/forumarchives/p...ost23355421.asp Link to comment Share on other sites More sharing options...
mlowery Posted August 2, 2008 Author Share Posted August 2, 2008 This could be tricky, it doesn't look like GDI+ offers full functionality for your needs:http://www.eggheadcafe.com/forumarchives/p...ost23355421.aspThat's what I noticed also. I'm hoping there is a DLL or other tool I can use (ImageMagick?) to find that data. The thread you linked mentions an Intel DLL, which I might be able to track down, but I'm not sure how to find documentation for the DLL calls if I do find it.EDIT: From reading the Wikipedia entry on JPEG, it looks like I may be able to infer a quality level by comparing the filesize with image dimensions, as higher quality will require more bits per pixel. That rough comparison will probably fail for a "noisy" image that doesn't compress well, though.I'll try some tests with that approach, but would love to have a "proper" solution if one exists. Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 2, 2008 Share Posted August 2, 2008 It may be possible that there isn't actually a "quality" value stored anywhere in the file. I think it may just be part of the compression algorithm. Just something to think about. Link to comment Share on other sites More sharing options...
mlowery Posted August 2, 2008 Author Share Posted August 2, 2008 ^^^ This turns out to be correct. Quality values are totally arbitrary and represented differently by different programs. Any quality value being displayed for an already-created file is just being inferred unless the app stores it in a tag. So, I'll just do some basic bits per pixel math and use that as a rough guide. Not perfect, but beats having nothing to go by! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now