0

I'm using Play Framework 1.2.4. and Blob Images.resize(File originalImage, File to, int w, int h) to resize a picture.

When the picture is Portrait (height is greater than width) the output is automatically rotated, how can I prevent this behavior?

Here are the examples:

Original Image:

Original Image before resize

Resized Image is rotated:

enter image description here

I appreciate any advice or comments.

biesior
  • 55,576
  • 10
  • 125
  • 182
Omid Monshizadeh
  • 1,514
  • 1
  • 10
  • 12

1 Answers1

0

Strange. Perhaps there is Exif data on the image (saying to display it rotated). This happens often with phone pictures. Does the same thing happen with landscape pictures?

I use this library: http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/ and it is not immune to the Exif rotation issue either. There are other SO posts about how to handle that: How to rotate JPEG images based on the orientation metadata?

Community
  • 1
  • 1
Tom Carchrae
  • 6,398
  • 2
  • 37
  • 36
  • landscape pictures are good, it seems like Blob prefers a landscape and rotates portrait to make it landscape, and thanks for the imgscalr like. – Omid Monshizadeh Sep 14 '12 at 18:21
  • you might try testing your theory by making a portrait sized picture with a paint program. i suspect it is exif data, rather than the dimensions. – Tom Carchrae Sep 18 '12 at 14:54