Bug #59216
closedImage dimensions (width/height) are 0 when not scaled
0%
Description
I have images inserted as media-references in page-records and use level-sliding for header-images with the below attached TypoScript. My source-images currently already have a width of 620 pixels, but could be larger would should be resized to maxW=620.
- If source-image is larger (will be resized) all is fine.
- If source-image already has the correct size, the img-tag will point to the original file - but width/height will be zero:
<img width="0" height="0" border="0" alt="" src="fileadmin/someimg.jpg">
- When I clear db-table sys_file_metadata and refresh the page, the img-width/height are added to the img-tag correctly.
- When clearing the frontend-cache again, the size is zero again.
Experienced with TYPO3 CMS 6.2.3, which afaik should already have all fixes from #46020 etc.
obj.headerimage = FILES obj.headerimage { references { table = pages #uid.data = leveluid:-1, slide #fieldName = media data = levelmedia:-1, slide } renderObj = IMAGE renderObj { file.import.data = file:current:publicUrl file.maxW = 620 } }
Files
Updated by Stefan Neufeind over 10 years ago
Workaround for the moment that works whether img needs to be scaled (processed) or not:
renderObj = IMG_RESOURCE
renderObj {
file.import.data = file:current:publicUrl
file.maxW = 620
stdWrap.wrap = <img src="|" width="620">
}
Updated by Markus Klein over 10 years ago
AFAIK the fieldName property is required. Don't know if that is related though.
Updated by Stefan Neufeind over 10 years ago
Just found that I'm missing image-dimensions for other text-with-images as well. After clearing sys_file_metadata all is well, for a while.
Updated by Stefan Neufeind over 10 years ago
Clearing sys_file_metadata and running the scheduler-job "File Abstraction Layer: Extract metadata in storage" I get metadata written to the DB - but with 0x0 pixels. How come? :-(
Updated by Frans Saris over 10 years ago
Are you using a local or remote storage?
Could test what for results getimagesize() give you for one of the files? As that is used the get the image dimensions.
Updated by Frans Saris over 10 years ago
- Status changed from New to Needs Feedback
Updated by Harald Dolderer over 10 years ago
the link above is unfortunately broken.
Same problem with image dimensions 0 for me.
We are using a local storage.
Updated by Alexander Opitz over 10 years ago
Updated by Frans Saris over 10 years ago
@Harald, are the dimensions 0 in both database (sys_file_metadate) and in the tag (html source) or only in the tag?
Btw, please do not use:
file.import.data = file:current:publicUrl
but:
file.import.data = file:current:originalUid // file:current:uid
The the current file record is used. Else the file is again fetched by identifier the old way
Updated by Harald Dolderer over 10 years ago
@Frans: width and height are 0 in the table sys_file_metadata and in the html source code.
Gererating metadata with sheduler Task fills the table also with height and width equal 0
Your change in line file.import.data seems to solve the problem.
Thank you for your quick responce.
Updated by Frans Saris over 10 years ago
The metadata are only updated by scheduler if lastmodification date of file is newer than last_indexed of the corresponding sys_file record.
If you upload a new file in BE are the width and height of the new created sys_file_metadata record filled?
Updated by Harald Dolderer over 10 years ago
too early pleased.
clearing the cache next time same again.
Updated by Frans Saris over 10 years ago
Are you sure the width and height of sys_file_metadata are empty?
Did you do a clean install of 6.2 or an update from 6.0/6.1.
Updated by Harald Dolderer over 10 years ago
- File screenshot.jpg screenshot.jpg added
yes I'm sure.
See screenshot.
It's an update from 6.1.9
Updated by Frans Saris over 10 years ago
Did you run all upgrade wizards in install tool and remove all obsolete columns from sys_file etc?
Updated by Harald Dolderer over 10 years ago
yes, I tried, but there is another bug which prevents the update manager to finish.
https://forge.typo3.org/issues/59567
Updated by Frans Saris over 10 years ago
Could you check if the width and height column are still present in sys_file. That could cause your problems.
Updated by Harald Dolderer over 10 years ago
that's it. This columns are present in 6.1 and are missing in 6.2.
May I create this columns by hand or is there another solution?
Updated by Frans Saris over 10 years ago
see my comments for #59567 maybe you can proceed the upgrade then.
If you remove the columns by hand you lose all width and height values that are already in DB.
Btw. Columns should be missing in 6.2. These are move from sys_file to sys_file_metadata
Updated by Markus Klein over 10 years ago
The columns are present in sys_file in 6.1 and will be migrated over to the new columns in 6.2 on the sys_file_metadata table.
So you don't need these columns anymore in 6.2 after they've been migrated.
It is important that your run the migration wizards right after switching the TYPO3 sources.
Updated by Harald Dolderer over 10 years ago
o.k,removing indexed search solves #59567.
The upgrade manager is now running till the end.
But the main problem is still available.
Between Upgrading to 6.2.3 and now no sites and no content was created.
Nothing was installed in addition.
You think installed indexed search interferes the update?
Updated by Frans Saris over 10 years ago
The install tool database analyser doesn't show any columns to be deleted?
I find it strange that when you upload a new image the width and height in the new sys_file_metadata record are not set.
Updated by Harald Dolderer over 10 years ago
I didn't say this.
New uploaded images are displayed in the right way, but it is impossible for me to upload many hundred images again and connect them with the content elements or news records. The problem is: Images which are displayed in a right way in 6.1. have the dimensions 0 after updating to 6.2.
I think I try the update tomorrow without indexed search again and report here again.
Updated by Frans Saris over 10 years ago
Oh, I understood that also for new uploaded files width and height where 0.
Have a look ar #46020 for some hint how to get width and height filled again.
But I think if you clear the column last_indexed of sys_file and run the fal indexer scheduler task (indexer not the metadata task) the width and height values of sys_file_metadata should be set/filled.
Updated by Harald Dolderer over 10 years ago
Updated by Frans Saris over 10 years ago
So you weren't on latest version of 6.2?
Updated by Harald Dolderer over 10 years ago
I was on latest version 6.2.3 but I made the update from 6.1.9 to 6.2.3 comletly new (with the obove mentioned patch7 installed). This solves my issue. After upgrade manager has run the file dimensions are available and the images are displayed in the right way.
Updated by Alexander Opitz about 10 years ago
- Status changed from Needs Feedback to New
Updated by Mathias Schreiber almost 10 years ago
- Target version set to 7.1 (Cleanup)
- Sprint Focus set to On Location Sprint
Updated by Frans Saris almost 10 years ago
- Category set to File Abstraction Layer (FAL)
Steffen can this issue be closed?
Updated by Stefan Neufeind almost 10 years ago
@Frans: I guess you meant me? I currently don't have the usecase at hand anymore, to easily test again against a recent version.
Updated by Anja Leichsenring almost 9 years ago
- Sprint Focus deleted (
On Location Sprint)