Project

General

Profile

Actions

Bug #59216

closed

Image dimensions (width/height) are 0 when not scaled

Added by Stefan Neufeind over 10 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2014-05-30
Due date:
% Done:

0%

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

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

screenshot.jpg (268 KB) screenshot.jpg Harald Dolderer, 2014-06-18 17:47

Related issues 10 (0 open10 closed)

Related to TYPO3 Core - Bug #46020: Image size is 0 when not scaledClosedAlexander Opitz2013-03-04

Actions
Related to TYPO3 Core - Bug #62400: Lot of entries in sys_file_processed with name=NULL and identifier emptyRejectedAndreas Wolf2014-10-22

Actions
Related to TYPO3 Core - Bug #61181: FAL: file maxW and maxH are ignoredRejected2014-08-25

Actions
Related to TYPO3 Core - Bug #44105: Image size does not get updatedClosed2012-12-19

Actions
Related to TYPO3 Core - Bug #45922: image replacement, width and height are kept even i change my imageClosed2013-02-28

Actions
Related to TYPO3 Core - Bug #46446: sys_file doesn't get updatedClosed2013-03-20

Actions
Related to TYPO3 Core - Bug #52658: Overriding image does not change the dimensionsRejected2013-10-10

Actions
Related to TYPO3 Core - Bug #54533: imgResource.noScale doesn't scale image tagRejected

Actions
Related to TYPO3 Core - Bug #58019: FAL Indexer for broken files: Column 'width' cannot be nullRejected2014-04-17

Actions
Related to TYPO3 Core - Bug #62247: FAL: Uppercase File Extensions of Image cannot be displayed RejectedBenni Mack2014-10-15

Actions
Actions #1

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 = &lt;img src=&quot;|&quot; width=&quot;620&quot;&gt;
}
Actions #2

Updated by Markus Klein over 10 years ago

AFAIK the fieldName property is required. Don't know if that is related though.

Actions #3

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.

Actions #4

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? :-(

Actions #5

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.

See https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Resource/Index/Indexer.php::extractRequiredMetaData()

Actions #6

Updated by Frans Saris over 10 years ago

  • Status changed from New to Needs Feedback
Actions #7

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.

Actions #9

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

Actions #10

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.

Actions #11

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?

Actions #12

Updated by Harald Dolderer over 10 years ago

too early pleased.
clearing the cache next time same again.

Actions #13

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.

Actions #14

Updated by Harald Dolderer over 10 years ago

yes I'm sure.
See screenshot.
It's an update from 6.1.9

Actions #15

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?

Actions #16

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

Actions #17

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.

Actions #18

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?

Actions #19

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

Actions #20

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.

Actions #21

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?

Actions #22

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.

Actions #23

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.

Actions #24

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.

Actions #25

Updated by Harald Dolderer over 10 years ago

unfortunately no.
importinig 6.1 database again and running the Upgrade withard again after patch7 from #57495 is installed solved the issue.
Now I am ready for a holiday. Thank's a lot for your help.
See also #57545

Actions #26

Updated by Frans Saris over 10 years ago

So you weren't on latest version of 6.2?

Actions #27

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.

Actions #28

Updated by Alexander Opitz about 10 years ago

  • Status changed from Needs Feedback to New
Actions #29

Updated by Mathias Schreiber almost 10 years ago

  • Target version set to 7.1 (Cleanup)
  • Sprint Focus set to On Location Sprint
Actions #30

Updated by Frans Saris almost 10 years ago

  • Category set to File Abstraction Layer (FAL)

Steffen can this issue be closed?

Actions #31

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.

Actions #32

Updated by Fabien Udriot almost 10 years ago

  • Status changed from New to Closed
Actions #33

Updated by Anja Leichsenring almost 9 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions

Also available in: Atom PDF