mwoffliner icon indicating copy to clipboard operation
mwoffliner copied to clipboard

mwoffliner drops downloaded images from zim creation if imagemin toolchain fails processing them

Open cm8 opened this issue 1 year ago • 1 comments

https://github.com/openzim/mwoffliner/blob/ad5dc1d6071552c1a9b577fa1a619cfba0fe6938/src/Downloader.ts#L504-L521

The catch in line 505 seems to miss an error handler: If the imagemin call fails, then a successfully downloaded image will be dropped from ZIM creation. mwoffliner can do better in these cases: if the size reduction fails, log and take the downloaded original.


As an example for a possibly failing image see https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Schleiflade_Tontraktur_Animation.gif/120px-Schleiflade_Tontraktur_Animation.gif

Prior to kohler/gifsicle@0e02f7b62a9a3a344c34f92ddb7e178ad3b3e3ff this file would fail a gifsicle run and thus not be included in any zim even if the resource successfully downloaded..

cm8 avatar Feb 01 '24 09:02 cm8

@cm8 Good catch if confirmed, we will have a look soon this your issue... or do you have a patch in mind ?

kelson42 avatar Jun 26 '24 11:06 kelson42