Earlier quoted context omitted.
I suppose the device wouldn't bother with lossless rotation when displaying on the screen. When it comes to saving the image, it has to be lossless, which would probably take a lot more computation power.
I'm not sure what is referred to by "lossless" rotation in the case of axis-aligned orientation. I can't see how you can do a lossy rotation.
"My images are all upside down"
41–47 of 47 posts
Re: "My images are all upside down"
#42I ran into the exact same problem a few days ago. Luckily, ImageMagick, which I'm using for processing uploaded images, has an auto-orient [1] option that allows you to do this automatically. Unfortunately, with JPEG this would cause some loss of quality, so we're probably going to have to keep the original quality image as well as the auto-orient'ed image to display on the site. Has anyone here worked on something s…
Re: "My images are all upside down"
#43Earlier quoted context omitted.
Right, but when you look through your photos laters, it has to transform them so up is up on the display.
But when browsing through already stored pictures, a bit of delay is totally ok. Not so much when quickly showing some information overlaid over the picture you've just taken.
Re: "My images are all upside down"
#44Earlier quoted context omitted.
Right, but when you look through your photos laters, it has to transform them so up is up on the display.
But when browsing through already stored pictures, a bit of delay is totally ok. Not so much when quickly showing some information overlaid over the picture you've just taken.
Re: "My images are all upside down"
#45Earlier quoted context omitted.
I'm not sure what is referred to by "lossless" rotation in the case of axis-aligned orientation. I can't see how you can do a lossy rotation.
Somebody covered this further up, but in more detail: It is not the rotation itself that is the problem, but saving the resultant file. If you're working directly with the pixel buffer you only do a lossless JPG rotation if the image height and width are multiples of 8 (or 16, in some situations). This is because once you've performed the rotation you'll need to save the resulting output as a JPG, and unless your dim…
Re: "My images are all upside down"
#46This would be easier to fix in objective-c and a little custom camera wrapper application. I would expect a fix in a new OS release though. But if you need this little app let me know and I'll write it and put it on github.
If your app directly accesses the camera with AVFoundation, saving photos is a lot less automatic than you might expect. It's easy to save the raw image data but you have to generate and add just about any interesting metadata (EXIF, GPS, TIFF, etc.) explicitly. It's hard to do right--as the rather many discussions on StackOverflow suggest--and definitely a steep price to pay for a customized camera interface.
The better way though is to use a class like this: https://github.com/gpambrozio/GusUtils/blob/master/GusUtils/...
I see your point though - it's not trivial. I just happen to have a lot of experience in this area. I do a lot of video/imaging on the iphone.
Re: "My images are all upside down"
#47Earlier quoted context omitted.
Somebody covered this further up, but in more detail: It is not the rotation itself that is the problem, but saving the resultant file. If you're working directly with the pixel buffer you only do a lossless JPG rotation if the image height and width are multiples of 8 (or 16, in some situations). This is because once you've performed the rotation you'll need to save the resulting output as a JPG, and unless your dim…
Very informative, thanks a lot. I hadn't considered that JPEG rotation is more complicated than regular bitmap rotation.