Delete unused Images

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
kai_lf
Posts: 7
Joined: 26 Mar 2021, 21:47

Delete unused Images

Post by kai_lf » 26 Mar 2021, 21:59

Hi,

we are running an AIMEOS Shop on TYPO3 and i'm wondering if there is a scheduler (or any other) Job for deleting unused product images.

We are importing products via csv and scheduler and it seems, that AIMEOS isn't recognizing images that are already imported - so there are many versions of the same product image on our server.
The /htdocs/public/uploads/tx_aimeos/ directory is about 7 GB big and we have "only" about 200 products ...

TYPO3: Version 9.5.26
AIMEOS: 19.10.12
LINUX: Ubuntu

Regards, Kai

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Delete unused Images

Post by aimeos » 28 Mar 2021, 08:13

Yes, we can confirm that this is a problem of the product CSV import here:
https://github.com/aimeos/ai-controller ... #L172-L185

The XML importer is more sophisticated:
https://github.com/aimeos/ai-controller ... #L110-L139
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Delete unused Images

Post by aimeos » 16 Apr 2021, 14:48

The next minor 2021.04.x release will contains the code for updating the media items from the XML importer
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kai_lf
Posts: 7
Joined: 26 Mar 2021, 21:47

Re: Delete unused Images

Post by kai_lf » 22 May 2023, 19:10

We have a project set up where we are using the XML importer for the products (and the attributes, suppliers, catalog...)
We have the same behavior as with the CSV Importer in the above post. On every import another preview pic will be generated.
Is it possible to do an update on the import - instead of generating new images?
Or is it possible to skip this process if the same image file name is in the import file?

This is the mediaitem node in the XML:

Code: Select all

 
 <mediaitem lists.msmstatus="0" lists.products_status="1" lists.type="default" lists.status="1">
          <media.type><![CDATA[default]]></media.type>
          <media.languageid><![CDATA[]]></media.languageid>
          <media.url><![CDATA[/Import/5b53f48326cd0a7316946a3faeb3e223_10.jpg]]></media.url>
          <media.label><![CDATA[5b53f48326cd0a7316946a3faeb3e223_10.jpg]]></media.label>
</mediaitem>
Any hint would help...

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Delete unused Images

Post by aimeos » 24 May 2023, 09:20

Preview images should be created once but then, only if the URL or file mtime changes (tested using 2022.10+):
- https://github.com/aimeos/ai-controller ... #L109-L134
- https://github.com/aimeos/ai-controller ... #L215-L238
- https://github.com/aimeos/aimeos-core/b ... #L768-L811

For the XML importer, the media entries must be always in the same order to use the existing media items without generating new previews.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply