Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
leedashone  
#1 Posted : Sunday, November 05, 2006 2:18:31 PM(UTC)
leedashone

Rank: Member

Groups: Member
Joined: 12/27/2005(UTC)
Posts: 8

ThumbNail AutoRotate feature is great, but have logic bug.

For example, this picture:

http://lee-1.com/temp/s1is-org.jpg

The Jpeg width/height of this image is 2048x1536, and Exif information show
the "Orientation" data is 6, so it's a Rotate 90 CW file.

ImageUploader 4 can AutoRotate this file's thumbnail very well.

But, sometimes , user already rotate the image with some software,
(ACDSee or ExifImageViewer.....etc),, then the logic bug come.

The sample "pre-rotated image file" can download at here:
http://lee-1.com/temp/s1is-rotated.jpg

If user pre-rotate the image file before upload,, this image file data will look like:

Jpeg Width/Height: 1536x2048
"Orientation" data still 6 (90 CW), (because most software keep exif data, no change.)

And Image Uploader will "Auto" rotate the ThumbNail again! -- but it's wrong.

So, The correct logic of AUtoRotate should be:

Code:
if  (ImgFile.ExifData.Orientaion <> 0) {   [color=#008000]//don't process any file without orientaion info[/color]
    if (ImgFile.JpegWidth > ImgFile.JpegHeight) {  [color=#800000]// W<H mean this file already rotated!![/color]
        Roate_ThumbNail_Then_Display()
    } else {
        Display_Origional_ThumbNail()
    }
} else {
    Display_Origional_ThumbNail()
}


Thanks. (sorry for my broken english)

Edited by user Tuesday, February 19, 2008 4:20:31 PM(UTC)  | Reason: Not specified

Alex Makhov  
#2 Posted : Wednesday, November 08, 2006 4:32:33 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups:
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

There is no Image Uploader bug. If any other application does not update the Orientation tag value while changing the image it works wrong. Your piece of code does not work when the original image’s width is higher than its height. So if the image file has wrong Orientation tag value Image Uploader will is unable to recognize it.
Sincerely yours,
Alex Makhov

UserPostedImage Follow Aurigma on Twitter!
leedashone  
#3 Posted : Wednesday, November 08, 2006 5:44:01 PM(UTC)
leedashone

Rank: Member

Groups: Member
Joined: 12/27/2005(UTC)
Posts: 8

I think you mis-unstanded the "EXIF tag" mean.

The "Orientation" information in EXIF header is not talk about
"what is this photo's rotate state"

Orientation is mean: "How a photographer/camera take this photo"

So, any software rotate the image without erase the exif orientaion tag is "CORRECT"

,, ok, even let us forget anything about exif., just talk about the "real world" :

The market leader of digital camera is CANON, all canon's camera after 2001 have
Orientaion Sensor.

If a Canon DC owner transfer photo from DC to PC with canon's boundle software ,
the photo will automatic rotate , and the exif "orientaion" tag are keep. , then if the boy
upload the photo to my site with ImageUpload4 + Autorotate enabled, all the vertical
photo will take mistake.

is it not a problem? and it's very easy to fix.

or, add a param for us?


Alex Makhov  
#4 Posted : Wednesday, November 08, 2006 5:54:06 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups:
Joined: 8/3/2003(UTC)
Posts: 998

So you could set the AllowAutoRotate property value to false for such users.

Edited by user Monday, February 25, 2008 5:24:50 PM(UTC)  | Reason: Not specified

Sincerely yours,
Alex Makhov

UserPostedImage Follow Aurigma on Twitter!
leedashone  
#5 Posted : Thursday, November 09, 2006 12:50:51 AM(UTC)
leedashone

Rank: Member

Groups: Member
Joined: 12/27/2005(UTC)
Posts: 8

I have no way to detect user's camera maker befor they upload compelte.
So, If I don't want canon's user take the mistake, my only way is disable this
feature for everybody.

And, even I can detect user's camera maker at client side, how can I do??
If the maker is Fujifilm, enable or disable? that's same, because fujifilm don't
have a Orientation sensor.

If I detect the user is use Canon camera (or any other maker have orientaion sensor),
then?

Enable this feature? somebody will take error.
Disable this feature? it's mean "ALL" user can't use autorotate.

- - -

If AutoRotate is not smart, it's a fair feature.

I hope you "THINK like a webmaster", not a programmer.

AutoRoatate is a great idel. but if you don't have a good logic, the user
(website's user) will confuse why their photo "sometimes looks ok sometimes worng"

Alex Makhov  
#6 Posted : Thursday, November 09, 2006 1:24:25 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups:
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

You can recognize the type of the user’s camera by using the ExtractExif property, which allows to specify the EXIF fields to be extracted and uploaded along with other data.

Edited by user Tuesday, February 19, 2008 4:23:16 PM(UTC)  | Reason: Not specified

Sincerely yours,
Alex Makhov

UserPostedImage Follow Aurigma on Twitter!
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.