Hi,
Still active user of cover_extract within Cygwin on Windows 10, while comic files are located on a NAS. However I noticed an issue when the files to extract from actually have a wrong extension, so a cbr file that is actually a zip file or a cbz file that is actually a rar file.
Cover_extract then tries to unpack with the wrong extraction utility of course. The question is however if this is to be addressed from within cover_extract (as renaming the files would do the trick but would require checking in advance yourself if files have actually the correct extension), but whenever there is an error (or maybe even before) it could actually check using "file" that the incorrect extension is being used. The comic reader reader would not object to it, hence it might go easily unnoticed that the wrong extension has been used.
cover_extract wouldn't even have to touch the original cbr/cbz file, but simply give an alert that the wrong extension is used and still proceed with the extraction regardless instead of failing by using unzip for a wrongly named .cbr file and vice versa use unrar for a wrongly named cbz file.
unzip reports:
"End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive."
unrar reports:
"ERROR: Can't extract cover from file "
So based on "file" output of such wrongly named cbr/cbz files it would use the other extraction method:
# file aaa.cbz
aaa.cbz: RAR archive data, v4, os: Win32
# file bbb.cbr
bbb.cbr : Zip archive data, at least v2.0 to extract
Hi,
Still active user of cover_extract within Cygwin on Windows 10, while comic files are located on a NAS. However I noticed an issue when the files to extract from actually have a wrong extension, so a cbr file that is actually a zip file or a cbz file that is actually a rar file.
Cover_extract then tries to unpack with the wrong extraction utility of course. The question is however if this is to be addressed from within cover_extract (as renaming the files would do the trick but would require checking in advance yourself if files have actually the correct extension), but whenever there is an error (or maybe even before) it could actually check using "file" that the incorrect extension is being used. The comic reader reader would not object to it, hence it might go easily unnoticed that the wrong extension has been used.
cover_extract wouldn't even have to touch the original cbr/cbz file, but simply give an alert that the wrong extension is used and still proceed with the extraction regardless instead of failing by using unzip for a wrongly named .cbr file and vice versa use unrar for a wrongly named cbz file.
unzip reports:
"End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive."
unrar reports:
"ERROR: Can't extract cover from file "
So based on "file" output of such wrongly named cbr/cbz files it would use the other extraction method: