Bug #86947

Gifbuilder: combine images generates duplicate images of the same picture.

Added by Arne Bracht Bracht 11 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Image Generation / GIFBUILDER
Target version:
-
Start date:
2018-11-17
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
Gifbuilder
Complexity:
Is Regression:
Sprint Focus:

Description

Since TYPO3 8.7.20 the Folder: typo3temp/assets/images/ growth extremly

I found that my gallery images are stored there, which are generated by the Gifbuilder.

Every time the frontend gallery is hit, a new image with watermark is generated:

csm_oehde9i_aaae4a5f3d_logo5_a77ed9c6fb.jpg
csm_oehde9i_aaae4a5f3d_logo5_f386a36af5.jpg
csm_oehde9i_aaae4a5f3d_logo5_71836c512b.jpg

The last digits change, filesize is the same and it's the same picture. So the images are not cached and the Folder growth unlimited.

TYPO3 8.7.19 is without this problem.

Thanks. Arne Bracht

lib.imageWithWatermark = COA
lib.imageWithWatermark {
  20 = IMAGE
  20 {
    file = GIFBUILDER
    file {
      XY = [10.w],[10.h]
      format = jpg
      quality = 100      

      10 = IMAGE
      10.file {
        import.data = current
        treatIdAsReference = 1
        width = 130c
        height = 100c
      }

      15 = IMAGE
      15.offset = [10.w]-29,[10.h]-40
      15.file = fileadmin/layout/images/logo5.png

    }
  }
}

Related issues

Related to TYPO3 Core - Bug #87224: GifBuilder creates filename hashes over and over Closed 2018-12-19
Related to TYPO3 Core - Bug #44518: Caching problem with Gifbuilder Closed 2013-01-14

Associated revisions

Revision 7d5e5944 (diff)
Added by Markus Klösges 7 months ago

[BUGFIX] GifBuilder returns already generated images

When combining image files with gifbuilder, the hash to identify the
resulting file is now stable with respect to the fact whether the
files are cropped or scaled in the current request or already cropped
before. That leads to stable hashes whenever the same images are
processed with the same configuration, and allows reuse as intended.

Also ensure that fileInfo returned from ContentObjectRenderer contains
width and height information as int, when they are returned from
database as that may lead to different serialized representations of the
configuration

Resolves: #44518
Resolves: #86947
Resolves: #87224
Releases: 8.7, 9.5, master
Change-Id: I833585034cacaf5a0ad66ba3ff04ac3920421085
Reviewed-on: https://review.typo3.org/c/59644
Tested-by: TYPO3com <>
Tested-by: Guido Schmechel <>
Tested-by: Benni Mack <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Guido Schmechel <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Stephan Großberndt <>
Reviewed-by: Benni Mack <>

Revision 8d584f74 (diff)
Added by Markus Klösges 7 months ago

[BUGFIX] GifBuilder returns already generated images

When combining image files with gifbuilder, the hash to identify the
resulting file is now stable with respect to the fact whether the
files are cropped or scaled in the current request or already cropped
before. That leads to stable hashes whenever the same images are
processed with the same configuration, and allows reuse as intended.

Also ensure that fileInfo returned from ContentObjectRenderer contains
width and height information as int, when they are returned from
database as that may lead to different serialized representations of the
configuration

Resolves: #44518
Resolves: #86947
Resolves: #87224
Releases: 8.7, 9.5, master
Change-Id: I833585034cacaf5a0ad66ba3ff04ac3920421085
Reviewed-on: https://review.typo3.org/c/59956
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Oliver Hader <>
Reviewed-by: Benni Mack <>

Revision 5bb260cb (diff)
Added by Markus Klösges 7 months ago

[BUGFIX] GifBuilder returns already generated images

When combining image files with gifbuilder, the hash to identify the
resulting file is now stable with respect to the fact whether the
files are cropped or scaled in the current request or already cropped
before. That leads to stable hashes whenever the same images are
processed with the same configuration, and allows reuse as intended.

Also ensure that fileInfo returned from ContentObjectRenderer contains
width and height information as int, when they are returned from
database as that may lead to different serialized representations of the
configuration

Resolves: #44518
Resolves: #86947
Resolves: #87224
Releases: 8.7, 9.5, master
Change-Id: I833585034cacaf5a0ad66ba3ff04ac3920421085
Reviewed-on: https://review.typo3.org/c/59959
Reviewed-by: Oliver Klee <>
Reviewed-by: Benni Mack <>
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>

History

#1 Updated by Guido Schmechel 11 months ago

Can reproduce it with the current master.

There are some differences in $this->setup which deliver a different md5 and so a different filename.

#2 Updated by Arne Bracht Bracht 11 months ago

I think this change in typo3/sysext/core/Classes/Resource/ProcessedFile.php

identifier == null to identifier === null
Line 406 is responsible for this failure.

https://github.com/TYPO3/TYPO3.CMS/commit/9bb994f492e75efcfe139c3d6a64ef42dbef9bd1

    /**
      * @return bool
     */
    public function usesOriginalFile()
    {
 -       return $this->identifier == null || $this->identifier === $this->originalFile->getIdentifier();
 +       return $this->identifier === null || $this->identifier === $this->originalFile->getIdentifier();
    }
     /**

#3 Updated by Guido Schmechel 11 months ago

We also had the guess. But the problem is probably even deeper.

I see in v 9.5 a changed "requestId". This is part of the Logger which is passed to a SignalSlot which is coming through the processing. Benni know about it and will check it. I spent two hours yesterday but could not find a really coherent position.

#4 Updated by Arne Bracht Bracht 10 months ago

Also, still exists in TYPO3 8.7.21

But i think i'm the last dinosaur who uses watermark images with pictures...

#5 Updated by Guido Schmechel 10 months ago

  • Related to Bug #87224: GifBuilder creates filename hashes over and over added

#6 Updated by Thomas Oliver Moll 10 months ago

  • Related to Bug #44518: Caching problem with Gifbuilder added

#7 Updated by Gerrit Code Review 8 months 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 https://review.typo3.org/59644

#8 Updated by Gerrit Code Review 8 months 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/59644

#9 Updated by Gerrit Code Review 8 months ago

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

#10 Updated by Gerrit Code Review 8 months ago

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

#11 Updated by Thomas Oliver Moll 8 months ago

Hi, would you please check if there is still a problem with the entry ['BBOX']['fileCacheHash']. I had to clear that one as well to get rid of all the additional files in assets/images when I implemented my workaround. (see https://forge.typo3.org/issues/87224#change-394579)

#12 Updated by Gerrit Code Review 8 months ago

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

#13 Updated by Gerrit Code Review 8 months 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/59644

#14 Updated by Gerrit Code Review 8 months 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/59644

#15 Updated by Gerrit Code Review 8 months ago

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

#16 Updated by Gerrit Code Review 8 months ago

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

#17 Updated by Ralph Brugger 8 months ago

Patch set 9 works great for us!

We've installed the 8.7.24 Update on Tuesday evening and hat after 24 hours 39 GB in:
typo3temp/assets/images

For some images we've had 2.000 copies.

Thanks!

#18 Updated by Gerrit Code Review 8 months ago

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

#19 Updated by Gerrit Code Review 8 months ago

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

#20 Updated by Gerrit Code Review 8 months ago

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

#21 Updated by Gerrit Code Review 8 months ago

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

#22 Updated by Gerrit Code Review 7 months ago

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

#23 Updated by Markus Klösges 7 months ago

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

#24 Updated by Gerrit Code Review 7 months ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59959

#25 Updated by Markus Klösges 7 months ago

  • Status changed from Under Review to Resolved

#26 Updated by Gerrit Code Review 7 months ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59959

#27 Updated by Markus Klösges 7 months ago

  • Status changed from Under Review to Resolved

#28 Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF