-------------------
--- SUMMARY ---
I am not new to PHP, but very new to ImageMagick + PHP and admit I don't fully understand how delegations work.
I have no trouble working getting Imagick to work with JPEGs and PNGs. So far, I've only tried simple stuff (thumbnails, etc).
However, I am having trouble getting IMagick to work with NEF files. IMagic insists on open them as 160x120 TIFF.
For the record, most of my files are 3039x2014 NEF files made by my Nikon D40.
--- MY ENVIRONMENT ---
- OS & Software -
NetBSD 4.0
Apache 2.2.9
PHP 5.2.6
ImageMagick 6.3.6.1
dcraw 8.82
ufraw 0.13
- delegates.xml -
<delegate decode="nef" command='"/usr/pkg/bin/dcraw -w -c "%i" > "%o"' />
--- WHAT WORKS ---
> convert input.NEF output.JPEG
Produces a jpeg same size as the original NEF file.
--- WHAT DOESN'T WORK ---
Code: Select all
<?php try {
$imageFilename = 'DSC_0007.NEF';
$image = new Imagick();
$image->pingImage($imageFilename);
echo 'Height: ' . $image->getImageHeight() . "<br />\n";
echo 'Width: ' . $image->getImageWidth() . "<br />\n";
echo 'Format: ' . $image->getImageFormat() . "<br />\n";
} catch(Exception $except) {
echo $except->getMessage(); } ?>
If I try the same script with $imageFilename = 'clouds39.jpg' , the format and dimensions returned match the original file.PHP Script Results wrote: Height: 120
Width: 160
Filetype: TIFF
Please point me in the right direction here. What am I doing wrong?