As designed Rotating images

DragonFlames

Active member
Hi,

After a recent import to XFMG latest version a lot of the images were rotated. No big deal and probably to do with the users fixing their rotation before upload to the old system but not knowing there was something in the image that could trigger an automated turn on some systems.

So, I have attempted to start to rotate them back to their correct state but I straight away found that the first image seemed to double in size when I did that. I can see no way for me to correct that other than to turn it back around to how it was. I can't see a way to fix this by doing things like downloading the original and uploading it to the same photo as a replacement, nor a way to regenerate the medium sized image from the full size one. So I have come to a halt.

To check it was not specific to my system I have uploaded the photo to the test area here. This is a link to it: https://xenforo.com/community/media/testing.1058/

If turned upright as it should be it seems to double in size. Turn it back on its side and it seems to be fine, though that means the image shows water dripping sideways.

Seemed best to report this, hope it helps.

Steve
 
There isn't anything that would actually double it in size.

I think I understand what you're describing though and it would be as designed.

The image you uploaded is very wide and not very tall (before rotation). We only allow images to have a max width of 100% (otherwise they'd break out of the container).

So when you rotate this image so it's now very tall but not very wide it may appear larger, but it is basically the expected effect.
 
I had a feeling you might say that... :)

I believe the image is a bog standard one that could be from an iPhone or any camera turned on its side to take the shot.

This is the neat looking image before the corrective turn:

normal.webp

This is what I think most members would expect to get from turning it, much as they see when turning images in Photoshop or whatever:



normal2.webp

This is what XFMG is displaying to me after the turn though. A double the width view that I think looks a bit yucky myself - but I do understand what you are saying and why:

xfmg.webp


Trying to guess at what might improve this, perhaps a setting for those who want it to set the max size of the longest side on medium size photos or something.

Thanks for your speedy reply anyway, and please forgive me if I ask the odd daft question as I get to grips with XFMG.

Steve
 
The thing is, that's the actual size of the image:

https://xenforo.com/community/media/testing.1058/full?d=1444314458

It is actually displaying much smaller in the gallery than it actually is. Comparing it to how it might look in Photoshop wouldn't really be appropriate. Photoshop allows you to zoom in or out of an image accordingly to make it easier to work with. That said, we do already implement a lightbox which does constrain the image to a maximum height - that would probably be the most appropriate size for viewing an image of this size. Really, this is definitely working how I would expect it to.
 
this is definitely working how I would expect it to

Yes as I say, I quite understand. It isn't a bug its the way it is designed to display etc. I accept that totally.

Sorry I originally thought it was, the doubling of the width etc. caught me by surprise.

Once I understood that I then meant to explain in my follow up that I thought that photo looked a little yucky that way, as I expect you agree, and that an option in the future sometime to constrain the size of the medium images so there is an option to have them not do that might be very welcome. Once I am more used to XFMG I will try and make some proper suggestions in the right place.

My mention of Photoshop was just as an industry example of how photos tend to be presented and turned and displayed. I think all online photo systems I have ever used offer to do it that sort of way for their medium size images. The system I just upgraded from to XFMG displayed that photo in its medium size view as this:

original.webp


The full size image is another option and you have that covered, and you have the download option too. All great and I like it all lots.. I just worry when a good looking image looks yucky like that. I feel the same about always having square cut outs for thumbnails. Either I'll have to get used to it all in time or you will add options in some later version to set other display types for medium images and thumbnails. I'm sorry I troubled you and I've used up enough of your time on this and I'm very happy with XFMG - it is vastly better than my old software. I better get back to turning all those images that are on their sides again now...:)

TTFN,

Steve
 
No need to apologise, it has gotten me re-thinking a few things (though this would be longer term, e.g. XFMG 2.0 level changes) and also reminds me of some ideas I had early on in development that I never got around to implementing. It was worth posting.

As a shorter term solution, you could look at playing around with some simple CSS:
Code:
.mediaContainer .imageContainer img {
    max-height: 550px;
}

Adding something like this to your EXTRA.css template may help, though it isn't perfect.
 
Thanks Chris, that does fix that image up quite nicely. I guess displaying the new smaller image in the middle of the available space rather than on the left would be the only other thing I'd probably consider.

I tried guessing at a position command to add but I think I need to study such commands for XFMG a little more.

Any new options you decide upon being in V2 would do me fine. I'm sure myself and others here will have lots of suggestions to make for that yet. I'm starting to wonder about things like backups and how best to make them, and then how to turn the backups back into photos if needed and so on at present... I expect I'll have lots of questions/ideas to mention as I get used to your very neat software.

Steve
 
Hello community,

some of my users report, that different pictures are rotating. Not everyone and also not pictures of all users in the same way.
Interesting is, that the pictures have been fine before. Are there any changes with the updates?

Its really anoying, so many users report problems with pictures. Maybe its also because of their smartphones, but is there no real solution?

Users never reported this problem before, so I wonder what changed...

One example of an user:
Screenshot_20200609-123543.png

In the german XenForo-Forum they told me, that there is no real solution and users have to try out it in different ways with their smartphones.

Pictures are a very important part of a forum, so I hope XenForo is seeing this as a real big problem for the usability and it would be great, if there is some kind of solution and not only semi-professional ad-onns.

Thx for any support and help! :)
 
Images uploaded via the attachment system should be rotated or flipped automatically. We use the EXIF data for this.

If you check your Admin CP what do you see for EXIF support?

1591712603732.webp

This should be set to "Yes" to support rotating images correctly.
 
I only can find a phrase about "EXIF"... :unsure:

Where exactly I can change this setting?

exif-xenforom3jzz.png
 
Sorry I should have explained more clearly.

On your Admin CP home page there is a "Server environment report" that is where my screenshot is from.

What is listed on yours next to "EXIF support"?
 
That's the expected value so that's good. It should be possible for those images to be rotated automatically.

This would point then to either the source images being a problem (not containing the information required to figure out how they should be rotated) or the images being a large size.

We only attempt to resize or rotate images if they are below a certain size by default. This is to avoid potential memory issues with resizing and transforming images.

PHP:
$config['maxImageResizePixelCount'] = 20000000;

That's the default value, you could consider adding that to your src/config.php file and changing the value to a much larger size, e.g.

PHP:
$config['maxImageResizePixelCount'] = 40000000;

The value is in pixels (20 megapixels by default) which we calculate by multiplying the width of the image and the height.

If you'd rather not change it, if you can establish the exact dimensions of the original images that might help us shed some light.

For example if the image was roughly 6000 x 4000 pixels then that would be a 24mp image which exceeds the default value so it would be the likely cause.

If it's actually a much smaller image then it could really only be that the image is simply that orientation and there is no rotation data embedded within it.
 
One example of an user:
View attachment 227383

View on my Android or HP about Firefox, Chrome, etc. same post:
hochkantw7jzp.png

 
Those images are hot-linked from another site. They aren't attachments. They weren't uploaded to your site so there is no way for us to rotate them. This is basically a problem then with the original image as it was when it was uploaded to wherever hosts it at the moment.
 
That's the expected value so that's good. It should be possible for those images to be rotated automatically.

This would point then to either the source images being a problem (not containing the information required to figure out how they should be rotated) or the images being a large size.

We only attempt to resize or rotate images if they are below a certain size by default. This is to avoid potential memory issues with resizing and transforming images.

PHP:
$config['maxImageResizePixelCount'] = 20000000;

That's the default value, you could consider adding that to your src/config.php file and changing the value to a much larger size, e.g.

PHP:
$config['maxImageResizePixelCount'] = 40000000;

The value is in pixels (20 megapixels by default) which we calculate by multiplying the width of the image and the height.

If you'd rather not change it, if you can establish the exact dimensions of the original images that might help us shed some light.

For example if the image was roughly 6000 x 4000 pixels then that would be a 24mp image which exceeds the default value so it would be the likely cause.

If it's actually a much smaller image then it could really only be that the image is simply that orientation and there is no rotation data embedded within it.

Thx!

The sample photo was much larger than the original file. In the meantime, I had set a new maximum size so that the images are reduced a bit when uploading, so that the loading times for the pages are not that long for some mobile accesses.

pix-maxe0jhv.png
 
Those images are hot-linked from another site. They aren't attachments. They weren't uploaded to your site so there is no way for us to rotate them. This is basically a problem then with the original image as it was when it was uploaded to wherever hosts it at the moment.

Ok thx, I understand, that effects the pictures before I allowed uploading pictures by XenForo-setting.


Users gave me the advise thx to this newer post:

But in this case the user uploaded the picture about the XenForo-Setting, but its a smal picture.
 
That example appears to be just that those images do not have the EXIF data built in to enable us to rotate them.

That can happen if it's a screenshot taken of an image, or it's manually shrunk or cropped in an app that either doesn't maintain the EXIF data or it just never had the rotation data to start with.
 
*edit: THX!

Its a smal picture and maybe there are no rotation data embedded within it? So I only can ask the user to check? *edit: Ok, thx, I gonna send this information to this user then. :)


Thx for your support and professional help already! (y):cool:
 
Just as a bit more detail, I downloaded the image from your site and looked at the EXIF metadata within it and this is the output:

Code:
array (
'FileSize' => 95269,
'FileType' => 2,
'MimeType' => 'image/jpeg',
'SectionsFound' => 'ANY_TAG, IFD0, EXIF',
'COMPUTED' =>
array (
'html' => 'width="640" height="480"',
'Height' => 480,
'Width' => 640,
'IsColor' => 1,
'ByteOrderMotorola' => 1,
),
'Orientation' => 1,
'Exif_IFD_Pointer' => 38,
'ColorSpace' => 65535,
'ExifImageWidth' => 640,
'ExifImageLength' => 480,
)

Note the orientation value specifically: 'Orientation' => 1,

A value of 1 means the image is the correct orientation and no adjustment is required so that's why uploading it didn't adjust it.
 
Top Bottom