The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
Actually, it does work for thumbnails, but the added line has to go in a different place than I thought. I added it near the beginning. Here's my code fragment, from includes/class_image.php, around line 760 (I added the line in red):
Code:
if ($thumbnail) { // Only specify scene 1 if this is a PSD or a PDF -- allows animated gifs to be resized.. $execute .= (in_array($imageinfo[2], array('PDF', 'PSD'))) ? " \"{$filename}\"[0] " : " \"$filename\""; } else { $execute .= " \"$filename\""; } $execute .= ' -auto-orient '; if ($imageinfo['scenes'] > 1 AND version_compare($this->version, '6.2.6', '>=')) { $execute .= ' -coalesce '; } Oh, I added that line to the code then went to the admincp, Maintenance > General Update Tools > Rebuild Attachment Thumbnails. But that will probably take a long time (it took me a minute and I only have a few test attachments), so you'd probably want to try it first by attaching a new image, or maybe don't run the rebuild but just let it work for new images, if you've been fixing the existing ones. |
#12
|
|||
|
|||
It works differently in different browsers, too. FF & Chrome behave differently than IE & Safari. At least, I THINK I have the browsers right - it's been a while since I tested them all when people were saying that the different size views displayed differently. In some browsers, the thumbnails & magnified views display in different orientations. In others, they're all sideways.
With multiple execute's, can the FIRST one that executes correct the orientation, and later ones do the resize & thumbnail creation as more passes through IM are made for the other views? Or does only 1 execute happen? With all those IF's I'm not sure yet whether more than one execute actually occurs before the process completes. |
#13
|
|||
|
|||
I'll have to look at things more closely when I get a chance. As I mentioned above I got the thumbnails to orient themselves, but the larger image that pops up still isn't right and I'm not sure why. Also, when you attach an image then edit the post you can double click and bring up a popup that lets you change the size, but once I did that nothing looked right any more, even when I went back to thumbnail.
|
#14
|
|||
|
|||
We've been correcting the images as we find them, so the rebuild probably isn't necessary for us. And I've noticed that IM seems to strip out the orientation & camera info tags when it resizes. So if it's resized first, there's no exif orientation tag to trigger the rotation. The only way I was able to track down the problem was by examining the few photos that were taken at low enough resolution that IM hadn't resized them as they were uploaded/stored on the MB. I used JPEGsnoop to see/analyze several of the weird photos. I've had a few users email me the original (untouched by IM) photos for comparison. The image quality ON SCREEN after resizing is ALMOST as good as the original. It's good enough to see most of the essential details, but not good enough for true archival/research work. If you'll give me your email in a PM, I'll send you a few if you want.
IMHO, the proper order of operations is: Rotate the full size photo if it contains an exif orientation tag, THEN generate the other views, with the largest view resized down to 1600W for storage after rotation to make the resulting image as large as reasonable for our available storage & bandwidth. Normally, 200x200 thumbnails are visible in the posts, and users can get progressively larger views by clicking on the visible photos. |
#15
|
||||
|
||||
The issue is not the forum software, the issue are the phones taking the pictures and only saving orientation data instead of actually rotating the picture correctly in the first place.
While I think it's worthwile to fix the problem in vBulletin, its unlikely to get backported to vBulletin 4. kh99, if the image isn't over any limits, we don't do any modifications to it. I'm guessing that you're going to need to write something to check if the image has the orientation metadata and then do something based on that to fix the image when we do image checking from the original upload. |
#16
|
|||
|
|||
I agree, the problem is only with the iPhone, Canon, Nikon and maybe a few other cameras. But it will probably get worse as cameras & cell phones improve and prices go down.
There are a LOT of iPhones out there - and they're not going to go away. I'm not sure, but ios8 may have fixed the problem - but that's just speculation. I haven't seen enough photos that I'm SURE are ios8. That info gets stripped out of the jpg's in the resize, and I never see the original photos to be sure. And I don't have an iPhone to test. Quote:
Do the rotation first if the orientation metadata is there, and THEN figure out whether it needs to be resized, etc. and do the rest of the processing. I've seen quite a few complaints about this problem on our MB and elsewhere, and I think it occurs in 5, too. I have no idea how they do it, but a lot of other web sites DO automatically orient the photos properly, so it's obviously NOT impossible. |
#17
|
|||
|
|||
Quote:
|
#18
|
|||
|
|||
I hope my insights have you pointed in the right direction.
I've noticed that some browsers ALWAYS display them wrong, and others seem to get it right for some magnifications. Maybe lightbox is still working with the un-rotated image after it's actually been rotated into the new file? Or does its thing too soon, before it's rotated - and the thumbnail is generated after rotation? There are so many IF's in there that I'm not sure. Maybe more than 1 -auto-orient is needed? It sure would be nice if there's an easy fix for ALL of us, even if it only works for future photos. I can live with that. It will save me a lot of trouble. |
#19
|
||||
|
||||
My point was to help get kh99 on the right track, and explain the problem.
kh99, there is a check in the IM processing part of the class_image to check the filetype, maybe you can run some code there. Mobile devices read and recognize the metadata, browsers don't care. Maybe they should, but they don't. |
#20
|
|||
|
|||
Well, I wanted to explore Bill's idea of adding -auto-orient, and since it turns out that fetch_thumbnail does all the resizing, and it's easy to add the option there, then I thought that might work. But as I said, the lightbox image doesn't work and I'm not sure why. But rather than track that down, I think it's better to try what Bill said and rotate it if necessary before doing anything else. A couple years ago I was working on a mod that read and displayed EXIF data from upload files that had it, so I know there's a hook where you can work on the uploaded file before anything else is done to it. I've just been looking in to that and I believe newattachment_start will work. So it's just a matter of writing the code to exec the IM programs using the temp file name, convert it to a new temp file name, then replace the name in $_FILE. It would be nice to use the existing code in the IM class, but that would mean modifying the file.
In any case I think I'm pretty much there and it's just down to the details of implementing it. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|