Delete unused Images
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!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Delete unused Images
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
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
Re: Delete unused Images
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
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, give us a star
If you like Aimeos, give us a star
Re: Delete unused Images
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, give us a star
If you like Aimeos, give us a star
Re: Delete unused Images
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:
Any hint would help...
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>
Re: Delete unused Images
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.
- 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, give us a star
If you like Aimeos, give us a star