Bug #54772
closedImage width and height has no effect
100%
Description
In the Fluid 6.2.0 ImageViewHelper width and height have no effect:
<f:image src="{image.uid}" alt="" maxWidth="150" maxHeight="150" width="150" height="150" treatIdAsReference="1" />
<f:image src="path/to/an/image800x800.jpg" alt="" maxWidth="150" maxHeight="150" width="150" height="150" />
both generate this Output:
<img src="path/to/an/image800x800.jpg" width="800" height="800" alt="">
This Bug occurs since version 6.2 beta2 (not in beta1)
Files
Updated by Nadine Schwingler over 10 years ago
- % Done changed from 0 to 10
I've got the same problem.
I made a quick and dirty fix in the TYPO3\CMS\Fluid\ViewHelpers\ImageViewHelper
replace
$this->tag->addAttribute('height', $processedImage->getProperty('height'));
$this->tag->addAttribute('width', $processedImage->getProperty('width'));
with
if ($height > 0) $this->tag->addAttribute('height', $height);
else $this->tag->addAttribute('height', $processedImage->getProperty('height'));
if ($width > 0) $this->tag->addAttribute('width', $width);
else $this->tag->addAttribute('width', $processedImage->getProperty('width'));
Updated by Thorsten G. over 10 years ago
UPDATE sys_file_metadata
INNER JOIN sys_file ON sys_file.uid = sys_file_metadata.file
SET sys_file_metadata.width = sys_file.zzz_deleted_width, sys_file_metadata.height = sys_file.zzz_deleted_height
WHERE sys_file_metadata.width = 0 AND sys_file.mime_type LIKE 'image/%'
Updated by Alexander Opitz about 10 years ago
- Status changed from New to Needs Feedback
Hi,
was this issue fixed or does it still exists?
Updated by Marti McFlight about 10 years ago
this bug is still there in TYPO3 6.2.5 :(
Updated by Alexander Opitz about 10 years ago
- Project changed from 2559 to TYPO3 Core
- Category changed from Fluid: ViewHelpers to Fluid
- Status changed from Needs Feedback to New
- % Done changed from 10 to 0
- TYPO3 Version set to 6.2
- Is Regression set to No
Updated by Dominik Hahn over 9 years ago
We are still having those issues in the newly released TYPO3 CMS 6.2.12
Updated by Carsten Tornow over 9 years ago
I have the same problem!
TYPO3 v. 6.2.12
Updated by Philipp Müller over 9 years ago
- File Screenshot-1.png Screenshot-1.png added
I've the same problem with TYPO3 6.2.13.
Code:
tt_content.image.20.stdWrap.override { cObject = COA cObject { 10 = FILES 10 { references { table = tt_content uid.field = uid fieldName = image } renderObj = IMAGE renderObj { file { import.data = file:current:publicUrl width = 154c height = 154c } stdWrap { typolink.parameter.data = file:current:publicUrl typolink.ATagParams = class="fancybox" rel="fancybox{field:uid}" typolink.ATagParams.insertData = 1 wrap = <div class="img">|</div> } } } wrap = <div class="images-overview">|<div class="clear"><!-- --></div></div> } if.value.field = layout if.equals = 1 }
Output:
Updated by König David over 9 years ago
- Target version set to 6.2.14
We have nearly a same issue.
We use TemplaVoila with dhbw_fal_templavoila
There is the field "field_pdf" where you can link a PDF-file, the other field is "field_pdfpreview", witch generate a preview image in frontend (configuration below.)
The Output generated in default language is:
<img src="fileadmin/_processed_/csm_myPDF_DE_f2d4554718.gif" width="164" height="188" class="imageborder" alt="alt text DE">
and in a other Language:
<img src="fileadmin/user_upload/path/to/myPDF_FR.pdf" width="0" height="0" class="imageborder" alt="alt text FR">
Code:
lib.field_pdfpreview.21 = FILES
lib.field_pdfpreview.21 {
references {
table = tt_content
uid.cObject = COA
uid.cObject {
10 = TEXT
10 {
data = register:tx_templavoila_pi1.parentRec.uid
if.isTrue.data = register:tx_templavoila_pi1.parentRec._LOCALIZED_UID
if.negate = 1
}
20 = TEXT
20 {
data = register:tx_templavoila_pi1.parentRec._LOCALIZED_UID
if.isTrue.data = register:tx_templavoila_pi1.parentRec._LOCALIZED_UID
}
}
fieldName = field_pdf
}
renderObj = COA
renderObj {
10 = IMAGE
10 {
file {
treatIdAsReference = 1
import.data = file:current:uid
maxW = 164
}
altText.field = field_caption
titleText.data = file:current:title
params = class="imageborder"
}
}
}
Updated by Alexander Opitz over 9 years ago
- Target version changed from 6.2.14 to 6.2.15
Updated by Alexander Opitz about 9 years ago
- Target version changed from 6.2.15 to 6.2.16
Updated by Claus Due about 9 years ago
Just a tiny update from the side lines: this issue has been reviewed, judging if it has any impact on or is affected by the merging of the standalone Fluid package as TYPO3 dependency.
Verdict: NOT AFFECTED, NOT SOLVED. Should be implemented pretty much as Nadine describes above - however, there's one pitfall: the "height" and "width" variables should also be checked if they are numeric; or they should be somehow sanitised to remove the "c" or "m" markers. And maybe some special attention on what happens if only one of the dimensions are provided.
Updated by Gerrit Code Review about 9 years ago
- Status changed from New 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 http://review.typo3.org/44138
Updated by Gerrit Code Review about 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/44138
Updated by Gerrit Code Review about 9 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/44138
Updated by Gerrit Code Review about 9 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/44138
Updated by Gerrit Code Review about 9 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/44138
Updated by Gerrit Code Review about 9 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44138
Updated by Gerrit Code Review about 9 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44138
Updated by Anonymous about 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 97c0da203f5d75ae5ddf527b02948d5264cc612d.
Updated by Morton Jonuschat about 9 years ago
- Status changed from Resolved to Rejected
This issue is not easily solvable if the image processing is disable/broken as there are many edge cases where the browser is not able to scale the same way as image processing does.
This issue won't be fixed for now in the core.