7.0.7 EPS to PNG conversion

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Locked
bally86
Posts: 6
Joined: 2020-03-30T08:00:16-07:00
Authentication code: 1152

7.0.7 EPS to PNG conversion

Post by bally86 »

Hi,
Can anyone help me with the following error.

Command:
magick convert K:\Development\kvsphp\storage\app\public\division_1\pim\products\afbeeldingen\dames-poloshirt-tricorp-casual-ppt200-black-xxl201015blackxxl-2704-b1rk.eps -resize 300x76 -depth 4 -strip K:\Development\kvsphp\storage\app\public\division_1\pim\products\afbeeldingen\dames-poloshirt-tricorp-casual-ppt200-black-xxl201015blackxxl-2704-b1rk.png -debug all -verbose

Log:

Code: Select all

2020-03-30T16:57:48+02:00 0:00.001 0.000u 7.0.7 Configure convert[15532]: utility.c/ExpandFilenames/959/Configure
  Command line: convert {K:\Development\kvsphp\storage\app\public\division_1\pim\products\afbeeldingen\dames-poloshirt-tricorp-casual-ppt200-black-xxl201015blackxxl-2704-b1rk.eps} {-resize} {300x76} {-depth} {4} {-strip} {K:\Development\kvsphp\storage\app\public\division_1\pim\products\afbeeldingen\dames-poloshirt-tricorp-casual-ppt200-black-xxl201015blackxxl-2704-b1rk.png} {-debug} {all} {-verbose}
2020-03-30T16:57:48+02:00 0:00.043 0.031u 7.0.7 Configure convert[15532]: nt-base.c/NTRegistryKeyLookup/2034/Configure
  SOFTWARE\ImageMagick\7.0.7\Q:16
2020-03-30T16:57:48+02:00 0:00.058 0.047u 7.0.7 Configure convert[15532]: configure.c/GetConfigureOptions/687/Configure
  Searching for configure file: "coder.xml"
2020-03-30T16:57:48+02:00 0:00.114 0.047u 7.0.7 Configure convert[15532]: configure.c/GetConfigureOptions/687/Configure
  Searching for configure file: "C:\Users\Michiel\AppData\Local\ImageMagick\coder.xml"
2020-03-30T16:57:48+02:00 0:00.154 0.063u 7.0.7 Configure convert[15532]: configure.c/GetConfigureOptions/687/Configure
  Searching for configure file: "C:\Program Files\ImageMagick\ImageMagick-7.0.7-11\bin\coder.xml"
2020-03-30T16:57:48+02:00 0:00.179 0.063u 7.0.7 Exception convert[15532]: configure.c/GetConfigureOptions/714/Exception
  UnableToOpenConfigureFile `coder.xml'
2020-03-30T16:57:48+02:00 0:00.190 0.063u 7.0.7 Module convert[15532]: module.c/OpenModule/1261/Module
  Searching for module "PS" using filename "IM_MOD_RL_PS_.dll"
2020-03-30T16:57:48+02:00 0:00.221 0.078u 7.0.7 Module convert[15532]: module.c/GetMagickModulePath/546/Module
  Searching for coder module file "IM_MOD_RL_PS_.dll" ...
2020-03-30T16:57:48+02:00 0:00.263 0.094u 7.0.7 Module convert[15532]: module.c/OpenModule/1270/Module
  Opening module at path "C:\Program Files\ImageMagick\ImageMagick-7.0.7-11\bin\IM_MOD_RL_PS_.dll"
2020-03-30T16:57:48+02:00 0:00.288 0.094u 7.0.7 Module convert[15532]: module.c/OpenModule/1297/Module
  Method "RegisterPSImage" in module "PS" at address 00007FF8AC392DF0
2020-03-30T16:57:48+02:00 0:00.301 0.094u 7.0.7 Module convert[15532]: module.c/OpenModule/1311/Module
  Method "UnregisterPSImage" in module "PS" at address 00007FF8AC392FD0
2020-03-30T16:57:48+02:00 0:00.337 0.094u 7.0.7 Configure convert[15532]: nt-base.c/NTRegistryKeyLookup/2034/Configure
  SOFTWARE\ImageMagick\7.0.7\Q:16
2020-03-30T16:57:49+02:00 0:00.357 0.109u 7.0.7 Configure convert[15532]: configure.c/GetConfigureOptions/687/Configure
  Searching for configure file: "magic.xml"
2020-03-30T16:57:49+02:00 0:00.391 0.109u 7.0.7 Configure convert[15532]: configure.c/GetConfigureOptions/687/Configure
  Searching for configure file: "C:\Users\Michiel\AppData\Local\ImageMagick\magic.xml"
2020-03-30T16:57:49+02:00 0:00.422 0.109u 7.0.7 Configure convert[15532]: configure.c/GetConfigureOptions/687/Configure
  Searching for configure file: "C:\Program Files\ImageMagick\ImageMagick-7.0.7-11\bin\magic.xml"
2020-03-30T16:57:49+02:00 0:00.456 0.109u 7.0.7 Exception convert[15532]: configure.c/GetConfigureOptions/714/Exception
  UnableToOpenConfigureFile `magic.xml'
2020-03-30T16:57:49+02:00 0:00.488 0.109u 7.0.7 Policy convert[15532]: policy.c/IsRightsAuthorized/604/Policy
  Domain: Path; rights=Read; pattern="K:\Development\kvsphp\storage\app\public\division_1\pim\products\afbeeldingen\dames-poloshirt-tricorp-casual-ppt200-black-xxl201015blackxxl-2704-b1rk.eps" ...
2020-03-30T16:57:49+02:00 0:00.530 0.109u 7.0.7 Blob convert[15532]: blob.c/OpenBlob/3207/Blob
    read 3 magic header bytes
2020-03-30T16:57:49+02:00 0:00.539 0.109u 7.0.7 Cache convert[15532]: cache.c/DestroyPixelCache/954/Cache
  destroy 
2020-03-30T16:57:49+02:00 0:00.556 0.125u 7.0.7 Module convert[15532]: module.c/OpenModule/1261/Module
  Searching for module "EPT" using filename "IM_MOD_RL_EPT_.dll"
2020-03-30T16:57:49+02:00 0:00.582 0.125u 7.0.7 Module convert[15532]: module.c/GetMagickModulePath/546/Module
  Searching for coder module file "IM_MOD_RL_EPT_.dll" ...
2020-03-30T16:57:49+02:00 0:00.608 0.125u 7.0.7 Module convert[15532]: module.c/OpenModule/1270/Module
  Opening module at path "C:\Program Files\ImageMagick\ImageMagick-7.0.7-11\bin\IM_MOD_RL_EPT_.dll"
2020-03-30T16:57:49+02:00 0:00.640 0.125u 7.0.7 Module convert[15532]: module.c/OpenModule/1297/Module
  Method "RegisterEPTImage" in module "EPT" at address 00007FF8D9E415B0
2020-03-30T16:57:49+02:00 0:00.670 0.125u 7.0.7 Module convert[15532]: module.c/OpenModule/1311/Module
  Method "UnregisterEPTImage" in module "EPT" at address 00007FF8D9E416B0
2020-03-30T16:57:49+02:00 0:00.707 0.125u 7.0.7 Policy convert[15532]: policy.c/IsRightsAuthorized/604/Policy
  Domain: Coder; rights=Read; pattern="EPT" ...
2020-03-30T16:57:49+02:00 0:00.719 0.141u 7.0.7 Policy convert[15532]: policy.c/IsRightsAuthorized/604/Policy
  Domain: Path; rights=Read; pattern="K:\Development\kvsphp\storage\app\public\division_1\pim\products\afbeeldingen\dames-poloshirt-tricorp-casual-ppt200-black-xxl201015blackxxl-2704-b1rk.eps" ...
2020-03-30T16:57:49+02:00 0:00.772 0.156u 7.0.7 Blob convert[15532]: blob.c/OpenBlob/3207/Blob
    read 3 magic header bytes
2020-03-30T16:57:49+02:00 0:00.804 0.172u 7.0.7 Cache convert[15532]: cache.c/DestroyPixelCache/954/Cache
  destroy 
2020-03-30T16:57:49+02:00 0:00.822 0.203u 7.0.7 Policy convert[15532]: policy.c/IsRightsAuthorized/604/Policy
  Domain: Path; rights=Read; pattern="K:\Development\kvsphp\storage\app\public\division_1\pim\products\afbeeldingen\dames-poloshirt-tricorp-casual-ppt200-black-xxl201015blackxxl-2704-b1rk.eps" ...
2020-03-30T16:57:49+02:00 0:00.873 0.203u 7.0.7 Blob convert[15532]: blob.c/OpenBlob/3207/Blob
    read 3 magic header bytes
2020-03-30T16:57:49+02:00 0:00.939 0.250u 7.0.7 Cache convert[15532]: cache.c/DestroyPixelCache/954/Cache
  destroy 
2020-03-30T16:57:49+02:00 0:00.948 0.266u 7.0.7 Resource convert[15532]: resource.c/AcquireUniqueFileResource/579/Resource
  ...
2020-03-30T16:57:49+02:00 0:00.959 0.266u 7.0.7 Resource convert[15532]: resource.c/AcquireUniqueFileResource/630/Resource
  C:/Users/Michiel/AppData/Local/Temp/magick-15532FgV2l9OwB8aW
2020-03-30T16:57:49+02:00 0:01.156 0.281u 7.0.7 Configure convert[15532]: nt-base.c/NTRegistryKeyLookup/2034/Configure
  SOFTWARE\ImageMagick\7.0.7\Q:16
2020-03-30T16:57:49+02:00 0:01.168 0.281u 7.0.7 Configure convert[15532]: configure.c/GetConfigureOptions/687/Configure
  Searching for configure file: "delegates.xml"
2020-03-30T16:57:49+02:00 0:01.190 0.281u 7.0.7 Configure convert[15532]: configure.c/GetConfigureOptions/687/Configure
  Searching for configure file: "C:\Users\Michiel\AppData\Local\ImageMagick\delegates.xml"
2020-03-30T16:57:49+02:00 0:01.239 0.281u 7.0.7 Configure convert[15532]: configure.c/GetConfigureOptions/687/Configure
  Searching for configure file: "C:\Program Files\ImageMagick\ImageMagick-7.0.7-11\bin\delegates.xml"
2020-03-30T16:57:49+02:00 0:01.262 0.281u 7.0.7 Exception convert[15532]: configure.c/GetConfigureOptions/714/Exception
  UnableToOpenConfigureFile `delegates.xml'
2020-03-30T16:57:49+02:00 0:01.274 0.281u 7.0.7 Configure convert[15532]: delegate.c/LoadDelegateCache/2014/Configure
  Loading delegate configuration file "built-in" ...
2020-03-30T16:57:49+02:00 0:01.305 0.297u 7.0.7 Policy convert[15532]: policy.c/IsRightsAuthorized/604/Policy
  Domain: Coder; rights=Read; pattern="PS" ...
2020-03-30T16:57:49+02:00 0:01.327 0.297u 7.0.7 Policy convert[15532]: policy.c/IsRightsAuthorized/604/Policy
  Domain: Path; rights=Read; pattern="C:/Users/Michiel/AppData/Local/Temp/magick-15532FgV2l9OwB8aW" ...
2020-03-30T16:57:50+02:00 0:01.354 0.313u 7.0.7 Blob convert[15532]: blob.c/OpenBlob/3207/Blob
    read 3 magic header bytes
2020-03-30T16:57:50+02:00 0:01.373 0.313u 7.0.7 Cache convert[15532]: cache.c/DestroyPixelCache/954/Cache
  destroy
2020-03-30T16:57:50+02:00 0:01.390 0.313u 7.0.7 Policy convert[15532]: policy.c/IsRightsAuthorized/604/Policy
  Domain: Path; rights=Read; pattern="C:/Users/Michiel/AppData/Local/Temp/magick-15532FgV2l9OwB8aW" ...
2020-03-30T16:57:50+02:00 0:01.424 0.313u 7.0.7 Blob convert[15532]: blob.c/OpenBlob/3207/Blob
    read 3 magic header bytes
2020-03-30T16:57:50+02:00 0:01.453 0.313u 7.0.7 Resource convert[15532]: resource.c/AcquireUniqueFileResource/579/Resource
  ...
2020-03-30T16:57:50+02:00 0:01.472 0.313u 7.0.7 Resource convert[15532]: resource.c/AcquireUniqueFileResource/630/Resource
  C:/Users/Michiel/AppData/Local/Temp/magick-15532_ka_nmWo_w-I
2020-03-30T16:57:55+02:00 0:07.049 5.875u 7.0.7 Resource convert[15532]: resource.c/AcquireUniqueFileResource/579/Resource
  ...
2020-03-30T16:57:55+02:00 0:07.059 5.875u 7.0.7 Resource convert[15532]: resource.c/AcquireUniqueFileResource/630/Resource
  C:/Users/Michiel/AppData/Local/Temp/magick-15532HoPp8K2OjPN5
2020-03-30T16:57:55+02:00 0:07.080 5.875u 7.0.7 Resource convert[15532]: resource.c/AcquireUniqueFileResource/579/Resource
  ...
2020-03-30T16:57:55+02:00 0:07.091 5.875u 7.0.7 Resource convert[15532]: resource.c/AcquireUniqueFileResource/630/Resource
  C:/Users/Michiel/AppData/Local/Temp/magick-15532liq5F_z42irR
2020-03-30T16:57:55+02:00 0:07.121 5.875u 7.0.7 Resource convert[15532]: resource.c/RelinquishUniqueFileResource/1073/Resource
  C:/Users/Michiel/AppData/Local/Temp/magick-15532liq5F_z42irR
2020-03-30T16:57:55+02:00 0:07.169 5.875u 7.0.7 Exception convert[15532]: utility.c/ShredFile/1844/Exception
  Failed to remove: C:/Users/Michiel/AppData/Local/Temp/magick-15532liq5F_z42irR.cache
2020-03-30T16:57:55+02:00 0:07.203 5.875u 7.0.7 Configure convert[15532]: nt-base.c/NTLocateGhostscript/1206/Configure
  Ghostscript (GPL Ghostscript) version 9.52
2020-03-30T16:57:55+02:00 0:07.223 5.875u 7.0.7 Configure convert[15532]: nt-base.c/NTGhostscriptGetString/1305/Configure
  registry: "HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\9.52\GS_DLL"="C:\Program Files\gs\gs9.52\bin\gsdll64.dll"
2020-03-30T16:57:55+02:00 0:07.259 5.906u 7.0.7 Exception convert[15532]: utility.c/ShredFile/1844/Exception
  Failed to remove: C:/Users/Michiel/AppData/Local/Temp/magick-15532_ka_nmWo_w-I
2020-03-30T16:57:55+02:00 0:07.285 5.906u 7.0.7 Exception convert[15532]: utility.c/ShredFile/1844/Exception
  Failed to remove: C:/Users/Michiel/AppData/Local/Temp/magick-15532FgV2l9OwB8aW
2020-03-30T16:57:55+02:00 0:07.320 5.906u 7.0.7 Exception convert[15532]: utility.c/ShredFile/1844/Exception
  Failed to remove: C:/Users/Michiel/AppData/Local/Temp/magick-15532HoPp8K2OjPN5

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: 7.0.7 EPS to PNG conversion

Post by snibgo »

The last thing in the command should be the output filename, not "-debug all" or "-verbose". If you want those options, put them at the start.
snibgo's IM pages: im.snibgo.com

bally86
Posts: 6
Joined: 2020-03-30T08:00:16-07:00
Authentication code: 1152

Re: 7.0.7 EPS to PNG conversion

Post by bally86 »

Okay, I switched to Ghostscript 9.04 and set the filename at the end. The conversion runs without errors. But my PNG file is black/white and the original eps is color. How can I solve this?

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: 7.0.7 EPS to PNG conversion

Post by snibgo »

Why have you switched to such an old version of Ghostscript?

You reduce the number of colours, perhaps to grayscale, with "-depth 4". Do you really want that? Try removing it.

If that doesn't help, please show your current command, and the input EPS, and your IM version, and the text output from "-verbose".
snibgo's IM pages: im.snibgo.com

bally86
Posts: 6
Joined: 2020-03-30T08:00:16-07:00
Authentication code: 1152

Re: 7.0.7 EPS to PNG conversion

Post by bally86 »

With the command below its working now, but now I want to use PHP wrapper to get the same result. When I run the code below the image is grayscale again. Does somebody know what i'm doing wrong?

Code: Select all

magick convert -colorspace sRGB BBC231.eps -background white -flatten BBC231.png
This is my php code:

Code: Select all

$imagick = new \Imagick(storage_path('BBC231.eps'));
$imagick->setImageColorspace(\Imagick::COLORSPACE_SRGB);
$imagick->setImageBackgroundColor('white');
$imagick = $imagick->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN);
$imagick->thumbnailImage(400, 400, true, true);
$imagick->writeImage(storage_path('BBC231.png'));

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 7.0.7 EPS to PNG conversion

Post by fmw42 »

try

$imagick->writeImage(storage_path('PNG24:BBC231.png'));

bally86
Posts: 6
Joined: 2020-03-30T08:00:16-07:00
Authentication code: 1152

Re: 7.0.7 EPS to PNG conversion

Post by bally86 »

Still grayscale :(

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: 7.0.7 EPS to PNG conversion

Post by snibgo »

Please link to the input EPS.
snibgo's IM pages: im.snibgo.com

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: 7.0.7 EPS to PNG conversion

Post by fmw42 »

What is storage_path and why the parentheses around the filename?

bally86
Posts: 6
Joined: 2020-03-30T08:00:16-07:00
Authentication code: 1152

Re: 7.0.7 EPS to PNG conversion

Post by bally86 »

storage_path is a build-in function of Laravel. The path is correct, otherwise there would be no output at all.

The file can be downloaded here: http://michielvanballegooijen.nl/BBC231.eps

This PDF file comes out as grayscale too: http://michielvanballegooijen.nl/Advert ... _groot.pdf

bally86
Posts: 6
Joined: 2020-03-30T08:00:16-07:00
Authentication code: 1152

Re: 7.0.7 EPS to PNG conversion

Post by bally86 »

Found out what I did wrong. I had to set the Colorspace before opening the file. The code below did the trick.

Code: Select all

$imagick = new \Imagick();
$imagick->setColorspace(\Imagick::COLORSPACE_SRGB);
$imagick->readImage(storage_path('BBC231.eps'));
$imagick->TransformImageColorSpace(\Imagick::COLORSPACE_SRGB);
$imagick->setImageBackgroundColor('white');
$imagick = $imagick->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN);
$imagick->setImageFormat("PNG24");
$imagick->thumbnailImage(400, 400, true, true);
$imagick->writeImage(storage_path('BBC231.png'));

Locked