Bug #57075

TYPO3 version 6.2beta images scale wrong when setting height in content element

Added by Vincent Mans over 5 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Must have
Category:
Image Cropping
Target version:
Start date:
2014-03-19
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Below, copied text from my additions to the English list. That describes the issue the best I suppose.

On the same server I have 6.1.x and 6.2 beta6. The first one scales images
properly, the newest one does not. The proportions get lost. Test setup is
okay.

It occurs very clearly on tiffs. Anybody any clue?

===

For instance, a .tiff (or .tif) image with w * h.

Original size:
652 * 791 => ratio = 0.82

When setting height in content element to 125px the resulting image becomes:
196 * 125 => ratio = 1.57
The 196px width should be 103px width in stead.

Setting width to e.g. 125px results in this:
125 * 152 => ratio = 0.82

Portrait tifs are narrowed. There is no tif going okay, even square ones
are flattened. And of course, this customer has all the images as tif.

With the images as .png it goes okay.

So, in conclusion, setting the height on .tiff/.tif makes the wrong ratio.
Only in 6.2 because on the same server (so same ImageMagick) with 6.1.7 I
encounter no problems.

Additional information:

Configuration Presets > Image handling settings mentions this:
ImageMagick version 6 or higher was not found in standard system paths.

Strange, because it works in the Install Tool Test setup. And it works in
6.1.7. (Is this buggy as well?)

All configuration (if it matters):

[GFX][imagefile_ext] = gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pd
[GFX][gdlib_png] = 1 (if 0, same problems)
[GFX][im_noScaleUp] = 0 (or 1, no difference)

Quality and Type settings make no difference.

That's about it I guess. Smells buggy, but I have no idea.

===

Yes, I confirm that the original height/width is in the sys_file_metadata
table are correct.

By the way, I haven't found this on jpg's so far, but they appear to be
correct. Watching it closely with png's I found a minor shift in width, for
instance 101px in stead of what should be 103px. And I see this effect only
when setting height.

sample.tif View (13.8 KB) Xavier Perseguers, 2014-03-20 12:04

sample.png View (271 Bytes) Xavier Perseguers, 2014-03-20 12:13

Associated revisions

Revision 19d6e38f (diff)
Added by Xavier Perseguers over 5 years ago

[BUGFIX] Invalid file used to compute image ratio in text with picture

Fixes: #57075
Releases: 6.2
Change-Id: Ided1204857dabf4fb15045056cc8a14010a53ae9
Reviewed-on: https://review.typo3.org/28558
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
Reviewed-by: Markus Klein
Tested-by: Markus Klein

History

#2 Updated by Xavier Perseguers over 5 years ago

Adding a sample TIFF image (652x791 as in description) so that we can try to reproduce.

#3 Updated by Xavier Perseguers over 5 years ago

Original size:
652 * 791 => ratio = 0.82

Used attached sample.tif

When setting height in content element to 125px the resulting image becomes:
196 * 125 => ratio = 1.57
The 196px width should be 103px width in stead.

I get 187x125 which is ratio 1.496

Setting width to e.g. 125px results in this:
125 * 152 => ratio = 0.82

Same for me.

By the way, I haven't found this on jpg's so far, but they appear to be
correct. Watching it closely with png's I found a minor shift in width, for
instance 101px in stead of what should be 103px. And I see this effect only
when setting height.

I get 188x125 with sample.png (instead of 187 with TIFF), so there is indeed a 1px difference (but the ratio is wrong anyway)

#4 Updated by Xavier Perseguers over 5 years ago

  • Assignee set to Xavier Perseguers
  • PHP Version set to 5.4

After a first quick debugging, it seems that the wrong FILEs are used to compute the resize ratio, which explains that ratio is wrong and we don't have the same values either.

#5 Updated by Gerrit Code Review over 5 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28558

#6 Updated by Gerrit Code Review over 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28558

#7 Updated by Xavier Perseguers over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#8 Updated by Riccardo De Contardi about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF