Hello to all,
I had noticed for some time now that rotating JPG pictures in DEVONthink would lower their file size, and quite obviously their quality. For instance a 2.5MB high resolution photo scan would become 700KB, which is quite unacceptable if you use DEVONthink to store and manage archival pictures.
The result is exactly the same when using Image Events in Applescript because both DEVONthink and Image Events appear to use the OS X Core Image library. This library probably does not use lossless rotation because it must work with any image format (png, gif, etc. do not feature orientation tags) and because all other functions have to modify the image data.
Another reason lossless rotation depends on the interpretation of the program that opens the image, so they prefer not to do it, even though the vast majority of programs will respect the orientation information in a picture. Finally, if anyone else does it, why not do it the same way: almost all picture editing programs — even Photoshop — end up recompressing the JPG after each modification that is saved to the disk.
Until now, I was using Preview whenever possible to rotate because the file size did not seem to change much, but today I realized it still changed, potentially losing quality, though much less.
So I created a script that uses ExifTool to alter only the EXIF orientation tag and not the image data at all. ExifTool must be installed on the system, which is as simple as launching the pkg found in the dmg downloadable there: http://www.sno.phy.queensu.ca/~phil/exiftool/)
Test it, the file size only changes by a few bytes (because the metadata is rewritten).
You can put those scripts in the Toolbar subfolder of DEVONthink’s Scripts folder, and drag and drop them to your toolbar. The scripts only work for pictures, not PDF pages. You can run them on several pictures. If you run them on non-JPEG pictures, it will do a standard Core Image rotation.
Please leave a brief message on this thread if you use it!
[Ed] Turn left and right (lossless for JPG).zip (33.1 KB)