News:

Wondering if this will always be free?  See why free is better.

Main Menu

Automatic Attachment Rotation (and Resize)

Started by dougiefresh, March 04, 2016, 07:34:59 PM

Previous topic - Next topic

landyvlad

OK cool thanks.

I checked one of the images with Photoshop to read the EXIF data - its has information on the camera etc but in none of the numerous potential categories of EXIF data did I see any image orientation flag....  Do you happen to know how this is recorded in EXIF data? (as in, what category, by what name/description)

Cheers
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

dougiefresh

Quote from: landyvlad on January 26, 2017, 09:26:19 PM
I checked one of the images with Photoshop to read the EXIF data - its has information on the camera etc but in none of the numerous potential categories of EXIF data did I see any image orientation flag.... 
Well, that would be why the mod can't rotate the picture.....

Quote from: landyvlad on January 26, 2017, 09:26:19 PM
Do you happen to know how this is recorded in EXIF data? (as in, what category, by what name/description)
Sorry, I don't know how it is recorded in the EXIF data.  The EXIF reading library that I included handles all of that processing if the built-in function exif_read_data doesn't exist. 

landyvlad

Yeah I'm just a bit confused by the exif data as there is no field (blank or otherwise) which apparently pertains to rotation / orientation. Perhaps it's called something not obvious...

As I say the camera has recorded basic EXIF camera type etc and I am ASSUMING that orientation would be considered as "basic" data so would ASSUME that this would have been recorded as well.

I'll have to take a photo so I KNOW it has exif data and test it.  Cheers.
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

PBSCreative

I've installed the extension, but it's still got the wrong orientation for images uploaded direct from iPhone.

Looking at Preview inspector on MacOS it puts the Orientation tag under "TIFF", not EXIF.

Could that be why it's being ignored?

dougiefresh

@PBSCreative: Can you attach the image so that I can try to figure out how to detect the orientation correctly for that image?

PBSCreative

Quote from: dougiefresh on February 05, 2017, 09:49:36 AM
@PBSCreative: Can you attach the image so that I can try to figure out how to detect the orientation correctly for that image?
Hi, thanks for responding. Here's an example, let's see if I can attach here or if I need to host it elsewhere for you to get an untangled version....

EXIF version difference maybe?
hxxp:www.exiv2.org/tags-xmp-tiff.html [nonactive]

dougiefresh

Uploaded v3.2 - February 6th, 2016
o Fixed function returning orientation when EXIF function is available.
o Fixed error generated by PBSCreative's image during alternative EXIF function testing.




@PBSCreative:  Thank you for attaching the picture.  Hopefully the problem has been fixed!

PBSCreative

Quote from: dougiefresh on February 06, 2017, 09:53:22 AM
Uploaded v3.2 - February 6th, 2016
o Fixed function returning orientation when EXIF function is available.
o Fixed error generated by PBSCreative's image during alternative EXIF function testing.




@PBSCreative:  Thank you for attaching the picture.  Hopefully the problem has been fixed!

That's great, thanks. Unfortunately I can't test in our environment with this image as it keeps white screening, I'm assuming PHP is running into a problem or out of memory. If I remove this extension it's OK.
I'll have to look later, as I can't find where this host server has buried its php error reporting logs.

KungFuJoe

I also get the white screen using 3.2 when trying to rotate an image after posting.

It appears to be somewhat random.  The good news is that...the one time it worked, it did correctly set the orientation for a photo I took with my iPhone.  The same image shows sideways when using 3.1 of the mod.

dougiefresh

Quote from: kungfujoe on February 06, 2017, 11:54:53 AM
I also get the white screen using 3.2 when trying to rotate an image after posting.

It appears to be somewhat random.  The good news is that...the one time it worked, it did correctly set the orientation for a photo I took with my iPhone.  The same image shows sideways when using 3.1 of the mod.
I'm going to take a guess and say that is a out-of-memory issue.  I'll see if I can figure something out, so that at least you won't white-screen, which means: If it has the memory to do the rotation/flip thing, it'll do so.....

landyvlad

best way to upgrade from 3.1 - uninstall 3.1 and install new one?
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

PBSCreative

Quote from: landyvlad on February 08, 2017, 04:16:54 AM
best way to upgrade from 3.1 - uninstall 3.1 and install new one?
That's what I did without a hitch.

dougiefresh

Uploaded v3.3 - February 10th, 2017
o Added code to attempt to get 128M of memory for our operations.
o Changed forum code to attempt to get 128M instead of 90M.




@kungfujoe:  Hopefully, this update fixes the out-of-memory issue you are seeing.....

Quote from: landyvlad on February 08, 2017, 04:16:54 AM
best way to upgrade from 3.1 - uninstall 3.1 and install new one?
That's the only way to upgrade.....

PBSCreative

Quote from: dougiefresh on February 10, 2017, 01:04:38 PM
Uploaded v3.3 - February 10th, 2017
o Added code to attempt to get 128M of memory for our operations.
o Changed forum code to attempt to get 128M instead of 90M.

We did this in the code late Friday and it sorted it. In the logs it was just tipping over the 90M of allocated memory.

KungFuJoe

I'm still getting the white screen issue with 3.3.

KungFuJoe

Quote from: PBSCreative on February 13, 2017, 05:34:58 AM
Quote from: dougiefresh on February 10, 2017, 01:04:38 PM
Uploaded v3.3 - February 10th, 2017
o Added code to attempt to get 128M of memory for our operations.
o Changed forum code to attempt to get 128M instead of 90M.

We did this in the code late Friday and it sorted it. In the logs it was just tipping over the 90M of allocated memory.

Where in the logs can you see how much memory is being used?

PBSCreative

Quote from: kungfujoe on February 13, 2017, 01:02:09 PM
Quote from: PBSCreative on February 13, 2017, 05:34:58 AM
Quote from: dougiefresh on February 10, 2017, 01:04:38 PM
Uploaded v3.3 - February 10th, 2017
o Added code to attempt to get 128M of memory for our operations.
o Changed forum code to attempt to get 128M instead of 90M.

We did this in the code late Friday and it sorted it. In the logs it was just tipping over the 90M of allocated memory.
When it was set to 90 it showed it was trying to allocate x bytes more than available.
Where in the logs can you see how much memory is being used?

dougiefresh

@kungfujoe:  I'm guessing PBSCreative meant server logs, not SMF logs.  The location of such logs would be specific to the server you are running on.....

KungFuJoe

I don't know if this is specific to the server I'm running on, but the issue I'm having with the white screen is with larger file sizes.  If I attach a <2MB pic...it's fine.  Tried a 2.8MB pic and white screen.

3.2 is better than 3.3 in this regard...in that I can attach larger sizes...but even with 3.2, when I tried to attach an 8MB pic, I got the white screen.

PBSCreative

Quote from: kungfujoe on February 16, 2017, 01:25:32 PM
I don't know if this is specific to the server I'm running on, but the issue I'm having with the white screen is with larger file sizes.  If I attach a <2MB pic...it's fine.  Tried a 2.8MB pic and white screen.

3.2 is better than 3.3 in this regard...in that I can attach larger sizes...but even with 3.2, when I tried to attach an 8MB pic, I got the white screen.
The bigger the image, the more resources required to process it. So small images will be OK with less memory.

Advertisement: