Page 1 of 2
Auto Lossless Rotation of All Images in Folder
Posted: 07 Feb 2015 17:25
by Drasden
Automatic Lossless Rotation of All Images in Current Folder & Refresh Image Cache.
[Using JPEG Lossless Rotator]
I know that XYplorer has commands for lossless rotation. But I am unaware of commands for automatically deciding the correct orientation, or doing this for an entire folder. (I could be wrong.)
This is a simple script I use to do it. Hope this helps save someone some time.
Download the version of JPEG Lossless Rotator that you need.
(32/64/portable versions available) at
http://annystudio.com/software/jpeglosslessrotator/
If it cannot rotate the image losslessly, the app will prompt you (unless you decide to suppress the warning messages).
To run it from your catalog the 'Action on click' should be the 'go to location' option.
Code: Select all
"Lossless Automatic Rotation + Refresh Img cache"
::run """C:\Path to your exe\jpegr.exe"" /auto <curpath_dos>\"; //Option, adding /s will suppress warning messages
#501; //optional, Refresh the image cache for good measure.
If a there is a previous that covers the same topic, just let me know and I'll remove this post.
Cheers.
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 03:43
by binocular222
Cannot auto rotate individual file. This not works
Code: Select all
run """E:\Media\JPEGLossless rotate\x64\jpegr.exe"" /auto ""<curitem>"""
because jpegr.exe expect the /auto switch to come with a folder instead of a file.
I need something to auto rotate individual file, so that I can assign to Portable File Association
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 08:31
by Stef123
Maybe I don't really grasp the question to start with. Are we talking EXIF-orientation tags? Which may be off kilter if the camera was held at weird angles in upside down positions. But then an auto-option wouldn't help, either
If "image cache" refers to thumbnail cache, doesn't XY's config > thumbnails > "auto-rotate thumbnails" take care of this?
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 09:21
by binocular222
It's EXIF-orientation tags. Not all software can detect and display correctly, thus I need PFA to edit the file before passing to the other "stupid" programs
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 09:36
by Stef123
I am getting closer, so is this not about "correcting" an orientation-tag, it's about missing or unreadable orientation tags? About a way to make certain pics fool-proof for stupid software? But how would you tell the software which way to turn? Other than re-painting the pic into standard landscape size?
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 13:47
by PeterH
Stef123 wrote:I am getting closer, so is this not about "correcting" an orientation-tag, it's about missing or unreadable orientation tags? About a way to make certain pics fool-proof for stupid software? But how would you tell the software which way to turn? Other than re-painting the pic into standard landscape size?
If I got it right: no!
It's about programs silly enough to ignore the tag.
You either can have a file in landscape orientation, but with orientation=portrait: then a program should turn it appropriate. But some don't
To help you can (lossless) turn the
physical data of such a file to portrait (and maybe reset orientation tag?) - then programs ignoring the flag will show it correct.
(Had this problem on showing .jpg from stick on a TV

)
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 14:29
by Stef123
Thanks Peter,
for taking the time to explain. You're right, I was on the wrong track. After reading more about the program it dawns on me that this is indeed about "repainting" pixels, well, maybe not repainting in a strict sense - that would hardly pass as lossless - but rather "re-arranging" pixels. Interesting approach. Also thanks to Drasden for bringing it up.
Would have never guessed why this were necessary, with so many good viewers out there that handle EXIF orientation. However, your TV example brings it home nicely.
@bino
sorry for the detour. I cannot answer your question about the run-command for a single file.
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 14:55
by binocular222
Anyone known a good portable rotator?
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 15:18
by PeterH
binocular222 wrote:Anyone known a good portable rotator?
In general: XYplorer
via
rotate scripting command.
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 15:35
by binocular222
XY cannot read EXIF to make correct auto-rotate
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 15:57
by admin
Of course it can, it does it all the time when displaying rotated JPEGs.

Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 16:05
by binocular222
Code: Select all
rotate [mode=90|180|270|h|v], [jpgfile_src], [jpgfile_trg], [only_if_lossless=0|1], [flags]
No "auto" mode?
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 16:15
by Stef123
Don, could you point to resources that explain the rationale behind XY's rotating feature? I am still trying to come to grips with this whole rotating business that does NOT rely on simply changing the orientation tag. Which of course, could be out of whack if there's a mismatch between physical pixel orientation and exif-tag. I don't see how this could be helped by an "auto-" fixing routine
Btw, no SC flag for the timestamp - whether to leave it alone or change it.
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 16:19
by admin
It's an idea for later.
Re: Auto Lossless Rotation of All Images in Folder
Posted: 10 Feb 2015 20:59
by PeterH
Stef123 wrote:Don, could you point to resources that explain the rationale behind XY's rotating feature? I am still trying to come to grips with this whole rotating business that does NOT rely on simply changing the orientation tag. Which of course, could be out of whack if there's a mismatch between physical pixel orientation and exif-tag. I don't see how this could be helped by an "auto-" fixing routine

See it this way: a picture has 300*200 pixels. (Example

) Shown normal it is landscape, with tag portrait it *should* be roteted and shown as portrait.
Now you might copy the file reordering the pixels "row by column": make 200*300 pixels - that *is* portrait. This is what's called "lossless rotation".
(At least as I understood it - correct my if I'm wrong!

)