Page 1 of 2
CR2 RAW file conversion
Posted: 2009-06-05T02:44:01-07:00
by testing
I'm trying to use CR2 conversion but it fails, at the moment I use the version: ImageMagick 6.5.3-2 2009-06-05 Q16 OpenMP
http://www.imagemagick.org
PHP code:
Code: Select all
$thumb = new Imagick("cr2:".$_SERVER['DOCUMENT_ROOT']."/test/image/test.cr2");
$thumb->resizeImage(200, 200, Imagick::FILTER_LANCZOS, 1);
$thumb->writeImage($_SERVER['DOCUMENT_ROOT']."/test/image/test.png");
$thumb->destroy();
This code results an error like
Code: Select all
Fatal error: Uncaught exception 'ImagickException' with message 'unable to open image `/tmp/magick-XXnx4mFF.pnm': No such file or directory @ blob.c/OpenBlob/2489' in /home/user/domains/domain.nl/public_html/test/image.php:12 Stack trace: #0 /home/user/domains/domain.nl/public_html/test/image.php(12): Imagick->__construct('cr2:/home/user...') #1 {main} thrown in /home/user/domains/domain.nl/public_html/test/image.php on line 12
* User and domain are fictief.
When I use the same code with an JPG, its works fine
PHP code:
Code: Select all
$thumb = new Imagick("cr2:".$_SERVER['DOCUMENT_ROOT']."/test/image/test.jpg");
$thumb->resizeImage(200, 200, Imagick::FILTER_LANCZOS, 1);
$thumb->writeImage($_SERVER['DOCUMENT_ROOT']."/test/image/test.png");
$thumb->destroy();
PHPinfo() result also:
ImageMagick Supported formats - CR2.
Re: CR2 RAW file conversion
Posted: 2009-06-05T11:15:27-07:00
by fmw42
do you have dcraw installed? I won't say for sure, but I believe you need that. see
http://www.imagemagick.org/Usage/formats/#crw
Re: CR2 RAW file conversion
Posted: 2009-06-05T11:26:55-07:00
by testing
Dcraw is not installed, I will install it and reply with my experiences. Thx for your input.
Re: CR2 RAW file conversion
Posted: 2009-06-05T12:13:25-07:00
by magick
ImageMagick requires the ufraw-batch delegate program to read the CR2 image format. Type
- convert -verbose image.cr2 image.png
to confirm.
Re: CR2 RAW file conversion
Posted: 2009-06-05T12:28:18-07:00
by testing
Code: Select all
convert -verbose /home/user/domains/domain.nl/public_html/test/image/test.cr2 /home/user/domains/domain.nl/public_html/test/image/test.png
Results: " convert: error while loading shared libraries: libMagickCore.so.2: cannot open shared object file: No such file or directory "
Re: CR2 RAW file conversion
Posted: 2009-06-05T13:06:45-07:00
by magick
You need to include libMagickCore.so in your dynamic library path (e.g. ldconfig /usr/local/lib).
Re: CR2 RAW file conversion
Posted: 2009-06-05T13:41:12-07:00
by testing
magick wrote:You need to include libMagickCore.so in your dynamic library path (e.g. ldconfig /usr/local/lib).
Done
Code: Select all
convert -verbose /home/user/domains/domain.nl/public_html/test/image/test.cr2 /home/user/domains/domain.nl/public_html/test/image/test.png
Result
Code: Select all
"ufraw-batch" --silent --wb=camera --black-point=auto --exposure=auto --create-id=also --out-type=ppm --out-depth=16 "--output=/tmp/magick-XXh7sBor.pnm" "/tmp/magick-
XXmaBUPw"
sh: ufraw-batch: command not found
convert: Delegate failed `"ufraw-batch" --silent --wb=camera --black-point=auto --exposure=auto --create-id=also --out-type=ppm --out-depth=16 "--output=%u.pnm" "%i"'
@ delegate.c/InvokeDelegate/1032.
convert: unable to open image `/tmp/magick-XXh7sBor.pnm': No such file or directory @ blob.c/OpenBlob/2489.
convert: missing an image filename `/home/user/domains/domain.nl/public_html/test/image/test.png' @ convert.c/ConvertImageCommand/2774.
Re: CR2 RAW file conversion
Posted: 2009-06-05T14:16:30-07:00
by fmw42
Sorry, I think IM switched from dcraw to ufraw some time ago. Probably need to install ufraw delegate library.
But it does not show in
http://www.imagemagick.org/download/delegates/
so you will have to Google search online for it.
Re: CR2 RAW file conversion
Posted: 2009-06-09T00:26:17-07:00
by testing
ufraw installed also
Code: Select all
/usr/local/bin/convert cr2:/home/user/domains/domain.nl/public_html/test/image/test.cr2 /home/user/domains/domain.nl/public_html/test/image/test.png
Results:
Code: Select all
ufraw-batch: unrecognized option `--silent'
convert: Delegate failed `"ufraw-batch" --silent --wb=camera --black-point=auto --exposure=auto --create-id=also --out-type=ppm --out-depth=16 "--output=%u.pnm" "%i"'
@ delegate.c/InvokeDelegate/1032.
convert: unable to open image `/tmp/magick-XXIsFPtP.pnm': No such file or directory @ blob.c/OpenBlob/2489.
convert: missing an image filename `/home/user/domains/domain.nl/public_html/test/image/test.png' @ convert.c/ConvertImageCommand/2774.
Re: CR2 RAW file conversion
Posted: 2009-06-09T05:26:31-07:00
by magick
Looks like you may have an older version of ufraw-batch. Edit delegates.xml and remove --silent from the dng:decode delegate.
Re: CR2 RAW file conversion
Posted: 2009-06-09T10:36:24-07:00
by testing
With an work-a-round installed ufraw 0.15
Try to test, and this results:
Code: Select all
/usr/local/bin/convert cr2:/home/user/domains/domain.nl/public_html/test/image/test.cr2 /home/user/domains/domain.nl/public_html/test/image/test.png
Results
Code: Select all
ufraw-batch: /usr/local/lib/libpng12.so.0: no version information available (required by ufraw-batch)
convert: Delegate failed `"ufraw-batch" --silent --wb=camera --black-point=auto --exposure=auto --create-id=also --out-type=ppm --out-depth=16 "--output=%u.pnm" "%i"'
@ delegate.c/InvokeDelegate/1032.
convert: unable to open image `/tmp/magick-XXmlKJjJ.pnm': No such file or directory @ blob.c/OpenBlob/2489.
convert: missing an image filename `/home/user/domains/domain.nl/public_html/test/image/test.png' @ convert.c/ConvertImageCommand/2774.
I have tryed something else
Code: Select all
/usr/local/bin/convert -verbose /home/user/domains/domain.nl/public_html/test/image/test.cr2 /home/user/domains/domain.nl/public_html/test/image/test.p
ng
Results
Code: Select all
"ufraw-batch" --silent --wb=camera --black-point=auto --exposure=auto --create-id=also --out-type=ppm --out-depth=16 "--output=/tmp/magick-XXYmF3f3.pnm" "/tmp/magick-
XXvzgOrE"
ufraw-batch: /usr/local/lib/libpng12.so.0: no version information available (required by ufraw-batch)
convert: Delegate failed `"ufraw-batch" --silent --wb=camera --black-point=auto --exposure=auto --create-id=also --out-type=ppm --out-depth=16 "--output=%u.pnm" "%i"'
@ delegate.c/InvokeDelegate/1032.
convert: unable to open image `/tmp/magick-XXYmF3f3.pnm': No such file or directory @ blob.c/OpenBlob/2489.
convert: missing an image filename `/home/user/domains/domain.nl/public_html/test/image/test.png' @ convert.c/ConvertImageCommand/2774.
Re: CR2 RAW file conversion
Posted: 2009-06-09T11:33:19-07:00
by magick
Not sure why its failing for you:
- -> identify -version
Version: ImageMagick 6.5.3-3 2009-06-08 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
-> convert -verbose IMG_2902.CR2 test.png
"/usr/bin/ufraw-batch" --silent --wb=camera --black-point=auto --exposure=auto --create-id=also --out-type=ppm --out-depth=16 "--output=/tmp/magick-XXIkJybH.pnm" "/tmp/magick-XXYLCy5F"
/tmp/magick-XXIkJybH.pnm PNM 2314x3474 2314x3474+0+0 16-bit DirectClass 46mb
IMG_2902.CR2=>/tmp/magick-XXIkJybH.pnm CR2 2314x3474 2314x3474+0+0 16-bit DirectClass 46mb
IMG_2902.CR2=>test.png CR2 2314x3474 2314x3474+0+0 16-bit DirectClass 37.73mb 3.090u 0:04
Re: CR2 RAW file conversion
Posted: 2009-06-09T11:49:59-07:00
by testing
Version: ImageMagick 6.5.3-2 2009-06-05 Q16 OpenMP
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
Maybe it's de CR2 file? Can you put your *.CR2 online? So we can test with the same file.
Re: CR2 RAW file conversion
Posted: 2009-06-09T13:14:15-07:00
by magick
Post a URL to your CR2 image and we'll try it at our site.
Re: CR2 RAW file conversion
Posted: 2009-06-09T13:22:44-07:00
by testing