![ImageMagick convert-im6.q16:无法打开图像 - 没有此文件或目录@error/blob.c/OpenBlob/2874](https://linux22.com/image/945353/ImageMagick%20convert-im6.q16%EF%BC%9A%E6%97%A0%E6%B3%95%E6%89%93%E5%BC%80%E5%9B%BE%E5%83%8F%20-%20%E6%B2%A1%E6%9C%89%E6%AD%A4%E6%96%87%E4%BB%B6%E6%88%96%E7%9B%AE%E5%BD%95%40error%2Fblob.c%2FOpenBlob%2F2874.png)
我在使用 ImageMagick 包中的转换命令脚本时遇到了一些问题。
以下是该行:
convert $dst_folder/$1/$2/$3 -resize 144x144\> $thb_folder/$1/$2/$thb_picture
其中 $1 和 $2 是文件夹名称(年份、月份),$3 是文件名
执行脚本时,出现以下类型的错误:
convert-im6.q16: unable to open image `/var/www/html/piwigo/galleries/2022/03_WH/IMG-20220314-WA0010.jpeg': No such file or directory @ error/blob.c/OpenBlob/2874.
convert-im6.q16: no images defined `/var/www/html/piwigo/_data/i/galleries/2022/03_WH/IMG-20220314-WA0010-th.jpeg' @ error/convert.c/ConvertImageCommand/3258.
convert-im6.q16: unable to open image `/var/www/html/piwigo/galleries/2022/03_WH/IMG-20220314-WA0010.jpeg': No such file or directory @ error/blob.c/OpenBlob/2874.
convert-im6.q16: no images defined `/var/www/html/piwigo/_data/i/galleries/2022/03_WH/IMG-20220314-WA0010-th.jpeg' @ error/convert.c/ConvertImageCommand/3258.
显然我检查了该文件是否存在并且具有足够的权限:
ls -l /var/www/html/piwigo/galleries/2022/03_WH/IMG-20220314-WA0010.jpeg
-rwxrwx--- 1 www-data www-all 1663905 Mar 20 12:55 /var/www/html/piwigo/galleries/2022/03_WH/IMG-20220314-WA0010.jpeg
(使用 sudo 运行的脚本)。但是,没有创建第 -th 个文件。
然而有趣的是,脚本中该行的第一次执行通常有效(WA0008)...直到它开始失败(WA0010):
generated thumbnail IMG-20220314-WA0008-th.jpeg for IMG-20220314-WA0008.jpeg (success)
convert-im6.q16: unable to open image `/var/www/html/piwigo/galleries/2022/03_WH/IMG-20220314-WA0010.jpeg': No such file or directory @ error/blob.c/OpenBlob/2874.
convert-im6.q16: no images defined `/var/www/html/piwigo/_data/i/galleries/2022/03_WH/IMG-20220314-WA0010-th.jpeg' @ error/convert.c/ConvertImageCommand/3258.
convert-im6.q16: unable to open image `/var/www/html/piwigo/galleries/2022/03_WH/IMG-20220314-WA0010.jpeg': No such file or directory @ error/blob.c/OpenBlob/2874.
convert-im6.q16: no images defined `/var/www/html/piwigo/_data/i/galleries/2022/03_WH/IMG-20220314-WA0010-th.jpeg' @ error/convert.c/ConvertImageCommand/3258.
chown: cannot access '/var/www/html/piwigo/_data/i/galleries/2022/03_WH/IMG-20220314-WA0010-th.jpeg': No such file or directory
chmod: cannot access '/var/www/html/piwigo/_data/i/galleries/2022/03_WH/IMG-20220314-WA0010-th.jpeg': No such file or directory
如果我再次运行脚本,这次文件 WA0010 被正确处理
generated thumbnail IMG-20220314-WA0010-th.jpeg for IMG-20220314-WA0010.jpeg (success)
我尝试使用“-limit memory 32”选项,但没有任何改善。
下面是当我在 WA0008 上使用 `-debug all' 但无法得出结论时的情况:
2022-03-20T12:33:05+01:00 0:00.000 0.000u 6.9.10 Configure convert-im6.q16[192323]: utility.c/ExpandFilenames/954/Configure
Command line: convert {-debug} {all} {/var/www/html/piwigo/galleries/2022/03_WH/IMG-20220314-WA0008.jpeg} {-resize} {144x144>} {/var/www/html/piwigo/_data/i/galleries/2022/03_WH/IMG-20220314-WA0008-th.jpeg}
2022-03-20T12:33:05+01:00 0:00.000 0.000u 6.9.10 Policy convert-im6.q16[192323]: policy.c/IsRightsAuthorized/604/Policy
Domain: Module; rights=Read; pattern="JPEG" ...
2022-03-20T12:33:05+01:00 0:00.000 0.000u 6.9.10 Configure convert-im6.q16[192323]: configure.c/GetConfigureOptions/685/Configure
Searching for configure file: "/usr/share/ImageMagick-6/coder.xml"
2022-03-20T12:33:05+01:00 0:00.000 0.000u 6.9.10 Configure convert-im6.q16[192323]: configure.c/GetConfigureOptions/685/Configure
Searching for configure file: "/usr/lib/x86_64-linux-gnu/ImageMagick-6.9.10//config-Q16/coder.xml"
2022-03-20T12:33:05+01:00 0:00.000 0.000u 6.9.10 Configure convert-im6.q16[192323]: configure.c/GetConfigureOptions/685/Configure
Searching for configure file: "/etc/ImageMagick-6/coder.xml"
2022-03-20T12:33:05+01:00 0:00.000 0.000u 6.9.10 Configure convert-im6.q16[192323]: configure.c/GetConfigureOptions/685/Configure
Searching for configure file: "/usr/share/doc/imagemagick-6-common/htmlcoder.xml"
2022-03-20T12:33:05+01:00 0:00.000 0.000u 6.9.10 Configure convert-im6.q16[192323]: configure.c/GetConfigureOptions/685/Configure
Searching for configure file: "/root/.config/ImageMagick/coder.xml"
2022-03-20T12:33:05+01:00 0:00.000 0.000u 6.9.10 Configure convert-im6.q16[192323]: configure.c/GetConfigureOptions/685/Configure
Searching for configure file: "/root/.magick/coder.xml"
2022-03-20T12:33:05+01:00 0:00.000 0.000u 6.9.10 Configure convert-im6.q16[192323]: coder.c/LoadCoderCache/818/Configure
Loading coder configuration file "/etc/ImageMagick-6/coder.xml" ...
2022-03-20T12:33:05+01:00 0:00.000 0.000u 6.9.10 Module convert-im6.q16[192323]: module.c/OpenModule/1300/Module
Searching for module "JPEG" using filename "jpeg.la"
2022-03-20T12:33:05+01:00 0:00.000 0.000u 6.9.10 Module convert-im6.q16[192323]: module.c/GetMagickModulePath/546/Module
Searching for coder module file "jpeg.la" ...
2022-03-20T12:33:05+01:00 0:00.000 0.000u 6.9.10 Module convert-im6.q16[192323]: module.c/OpenModule/1309/Module
Opening module at path "/usr/lib/x86_64-linux-gnu/ImageMagick-6.9.10/modules-Q16/coders/jpeg.la"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Module convert-im6.q16[192323]: module.c/OpenModule/1336/Module
Method "RegisterJPEGImage" in module "JPEG" at address 0x7ff1dd3d05b0
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Module convert-im6.q16[192323]: module.c/OpenModule/1350/Module
Method "UnregisterJPEGImage" in module "JPEG" at address 0x7ff1dd3d08d0
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Policy convert-im6.q16[192323]: policy.c/IsRightsAuthorized/604/Policy
Domain: Path; rights=Read; pattern="/var/www/html/piwigo/galleries/2022/03_WH/IMG-20220314-WA0008.jpeg" ...
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Locale convert-im6.q16[192323]: locale.c/GetLocaleOptions/856/Locale
Searching for locale file: "/usr/share/ImageMagick-6/locale.xml"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Locale convert-im6.q16[192323]: locale.c/GetLocaleOptions/856/Locale
Searching for locale file: "/usr/lib/x86_64-linux-gnu/ImageMagick-6.9.10//config-Q16/locale.xml"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Locale convert-im6.q16[192323]: locale.c/GetLocaleOptions/856/Locale
Searching for locale file: "/etc/ImageMagick-6/locale.xml"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Locale convert-im6.q16[192323]: locale.c/GetLocaleOptions/856/Locale
Searching for locale file: "/usr/share/doc/imagemagick-6-common/htmllocale.xml"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Locale convert-im6.q16[192323]: locale.c/GetLocaleOptions/856/Locale
Searching for locale file: "/root/.config/ImageMagick/locale.xml"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Locale convert-im6.q16[192323]: locale.c/GetLocaleOptions/856/Locale
Searching for locale file: "/root/.magick/locale.xml"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Configure convert-im6.q16[192323]: locale.c/LoadLocaleCache/1209/Configure
Loading locale configure file "/usr/share/ImageMagick-6/locale.xml" ...
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Locale convert-im6.q16[192323]: locale.c/GetLocaleOptions/856/Locale
Searching for locale file: "/usr/share/ImageMagick-6/english.xml"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Locale convert-im6.q16[192323]: locale.c/GetLocaleOptions/856/Locale
Searching for locale file: "/usr/lib/x86_64-linux-gnu/ImageMagick-6.9.10//config-Q16/english.xml"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Locale convert-im6.q16[192323]: locale.c/GetLocaleOptions/856/Locale
Searching for locale file: "/etc/ImageMagick-6/english.xml"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Locale convert-im6.q16[192323]: locale.c/GetLocaleOptions/856/Locale
Searching for locale file: "/usr/share/doc/imagemagick-6-common/htmlenglish.xml"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Locale convert-im6.q16[192323]: locale.c/GetLocaleOptions/856/Locale
Searching for locale file: "/root/.config/ImageMagick/english.xml"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Locale convert-im6.q16[192323]: locale.c/GetLocaleOptions/856/Locale
Searching for locale file: "/root/.magick/english.xml"
2022-03-20T12:33:05+01:00 0:00.010 0.000u 6.9.10 Configure convert-im6.q16[192323]: locale.c/LoadLocaleCache/1209/Configure
Loading locale configure file "/usr/share/ImageMagick-6/english.xml" ...
2022-03-20T12:33:05+01:00 0:00.010 0.010u 6.9.10 Exception convert-im6.q16[192323]: blob.c/OpenBlob/2874/Exception
unable to open image `/var/www/html/piwigo/galleries/2022/03_WH/IMG-20220314-WA0008.jpeg': No such file or directory
2022-03-20T12:33:05+01:00 0:00.010 0.010u 6.9.10 Cache convert-im6.q16[192323]: cache.c/DestroyPixelCache/1182/Cache
destroy
2022-03-20T12:33:05+01:00 0:00.010 0.010u 6.9.10 Policy convert-im6.q16[192323]: policy.c/IsRightsAuthorized/604/Policy
Domain: Path; rights=Read; pattern="/var/www/html/piwigo/galleries/2022/03_WH/IMG-20220314-WA0008.jpeg" ...
2022-03-20T12:33:05+01:00 0:00.010 0.010u 6.9.10 Exception convert-im6.q16[192323]: blob.c/OpenBlob/2874/Exception
unable to open image `/var/www/html/piwigo/galleries/2022/03_WH/IMG-20220314-WA0008.jpeg': No such file or directory
2022-03-20T12:33:05+01:00 0:00.010 0.010u 6.9.10 Cache convert-im6.q16[192323]: cache.c/DestroyPixelCache/1182/Cache
destroy
2022-03-20T12:33:05+01:00 0:00.010 0.010u 6.9.10 Exception convert-im6.q16[192323]: convert.c/ConvertImageCommand/3258/Exception
no images defined `/var/www/html/piwigo/_data/i/galleries/2022/03_WH/IMG-20220314-WA0008-th.jpeg'
convert-im6.q16: unable to open image `/var/www/html/piwigo/galleries/2022/03_WH/IMG-20220314-WA0008.jpeg': No such file or directory @ error/blob.c/OpenBlob/2874.
convert-im6.q16: no images defined `/var/www/html/piwigo/_data/i/galleries/2022/03_WH/IMG-20220314-WA0008-th.jpeg' @ error/convert.c/ConvertImageCommand/3258.
chown: cannot access '/var/www/html/piwigo/_data/i/galleries/2022/03_WH/IMG-20220314-WA0008-th.jpeg': No such file or directory
chmod: cannot access '/var/www/html/piwigo/_data/i/galleries/2022/03_WH/IMG-20220314-WA0008-th.jpeg': No such file or directory
在我看来,这看起来像是 convert 中的一个错误,除非我误用了它。有办法解决这个问题吗?
谢谢
答案1
所以最终通过替换解决了这个问题
convert $dst_folder/$1/$2/$3 -resize 144x144\> $thb_folder/$1/$2/$thb_picture
经过
convert $dst_folder/$1/$2/$3 -thumbnail '144x144>' $thb_folder/$1/$2/$thb_picture
然而,这并不能解释为什么我在调整大小选项时遇到了一些问题。
干杯