Project

General

Profile

Actions

Bug #37597

closed

Negative image width if first image is a png

Added by Thomas Layh almost 12 years ago. Updated almost 9 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
Category:
-
Target version:
Start date:
2012-05-30
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

How to reproduce:

Select a content element of type "Image" and add e.g. 3 images. If the first image is a png and the other two images are jpgs, the image size of the first image is negative. Don't select a width or height and set the number of columns to 3.

If you move one of the jpg images to the first position, the image width is calculated correctly.

This happens in version 4.5.15 and in the current master.

I searched in class.tx_cssstyledcontent_pi1.php for a while, but I am not sure how to solve this. I will push a patch to review in a couple of minutes, but my guess is, that this is not enough to fix this correctly.


Files

negative-image-width.png (138 KB) negative-image-width.png Thomas Layh, 2012-05-30 10:14
first-image-png-negative-width.png (119 KB) first-image-png-negative-width.png More than 1 image per row. First image png. Negative width. Martin Günther, 2013-04-10 09:08
first-image-jpg-not-scaled.png (347 KB) first-image-jpg-not-scaled.png More than 1 image per row. First image jpg. Scaled to original size. Martin Günther, 2013-04-10 09:08
one-image-per-row-first-png.png (112 KB) one-image-per-row-first-png.png 1 image per row. First image png. Everything ok. Martin Günther, 2013-04-10 09:08
one-image-per-row-first-jpg.png (112 KB) one-image-per-row-first-jpg.png 1 image per row. First image jpg. Everything ok. Martin Günther, 2013-04-10 09:08
Actions #1

Updated by Gerrit Code Review almost 12 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11714

Actions #2

Updated by Thomas Layh almost 12 years ago

PHP Version: 5.3.10
GraphicsMagick 1.3.12

Updated by Martin Günther about 11 years ago

I'm currently having (almost) the same issue.

The first image has a negative width when .png.

If first image is .jpeg it gets scaled to size of original image. Width is set to original image width.

This always concerns only the first image of a row if there are more than one images in a row. It does not make a difference there if 2, 3, 4, ... images per Row. Always the first image has a negativ width if .pgn: width="-10px" when 2 images in row, "-20px" when 3, "-30px" when 4 images in a row, ...
If .jpeg width is same as original image.

Other findings:
- first .png image get's scaled to size of original even if it should not get sclaed. Result: negative width. If I set "Quality & Type" from "default" to "none" everything is fine. First image does not get scaled anymore and width is correct.
- If first image .jpg and should get scaled because of maxWidth / MaxHeight it gets scaled to original dimensions. width = width of original image.
- If only one image per row everything is fine.
- I tested older static CSS Styled Content templates: the "problem" does not occur with CSS Styled Content TYPO3 v3.8.

Typo3 Version 4.5.25
PHP: 5.2.17
ImageMagick: Thaught it is an ImageMagick issue, so I tested 4.2.9 (static), 6.5.9 (static), 6.6.0-4 --> same result with all tested versions

Hope this helps. Let me know if I can help.

Actions #4

Updated by Christian Althoff over 10 years ago

This issue occured at my installation again. As described by Martin Günther the first image in a row gets scaled to its original size. In my installation it does not matter if a png is uploaded, I just added three jpgs for testing and it still shows the behaviour. Also it is always the first picture in a row not depending on how many pics per row you set.

The following Typoscript scales and crops all other pictures correctly:

tt_content.image.20.1.file.width.field >
tt_content.image.20.1.file.width = 220c
tt_content.image.20.1.file.height = 180c
tt_content.image.20.1.file.width.override.field = imagewidth
tt_content.image.20.1.file.height.override.field = imageheight
tt_content.image.20.equalH >
tt_content.image.20.equalW >

Typo3 Version 6.1.7
PHP 5.3.19
GraphicsMagick 1.2.7
CSS Styled Content included in the not numbered version.

Are there any news about this bug?

Actions #5

Updated by Gerrit Code Review over 9 years ago

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

Actions #6

Updated by Benni Mack over 9 years ago

  • Status changed from Under Review to Needs Feedback
  • Assignee set to Benni Mack
  • Is Regression set to No

Sorry, I really cannot reproduce this issue. I suggest you checkout the patch from Thomas and see if this fixes your problem, if so, please vote for it. Or give me an installation where I can verify this. I really want to help you but it's hard if I cannot reproduce this problem.

Actions #7

Updated by Benni Mack about 9 years ago

  • Target version set to next-patchlevel

Any update from any reporter about this issue would be great, otherwise I will close this issue and mark it as "not reproducable".

Actions #8

Updated by Benni Mack almost 9 years ago

  • Status changed from Needs Feedback to Rejected

cannot reproduce in 6.2 or 7, thus will be closed. if you can help me reproduce this one, feel free to contact me via _ I can then open up this issue again.

Actions

Also available in: Atom PDF