Page 1 of 1
NEF to JPG apache error.
Posted: 2015-03-26T16:08:14-07:00
by circleb
I'm trying to convert an .NEF to a .JPG with php on a local testing site being served from my computer.
I can do the conversion from terminal no problem, but my PHP/Apache site gives me this error:
Code: Select all
PHP Fatal error: Uncaught exception 'ImagickException' with message 'unable to open image `/var/tmp/magick-55934Og9gB9rb6P.ppm': No such file or directory @ error/blob.c/OpenBlob/2675' in /***/image.php:2\nStack trace:\n#0 /***/image.php(2): Imagick->__construct('DSC4741.nef')\n#1 {main}\n thrown in /***/image.php on line 2
Here's my system info:
- • ImageMagick 6.9.0-10 Q16 x86_64 2015-03-25
• OS X Yosemite
I originally posted this:
http://stackoverflow.com/questions/2927 ... magemagick but they finally told me I should try this forum.
Thanks in advance!
Re: NEF to JPG apache error.
Posted: 2015-03-26T17:19:27-07:00
by magick
The NEF coder depends on the ufraw-batch command-line program. Is that installed?
Re: NEF to JPG apache error.
Posted: 2015-03-26T17:31:29-07:00
by circleb
I installed ufraw with homebrew, does that include ufraw-bach?
Re: NEF to JPG apache error.
Posted: 2015-03-27T07:18:30-07:00
by circleb
I tried using exec() — to call the exact command that runs fine in terminal — from PHP (I was using Imagick() originally), but I'm getting this error in my apache log:
Code: Select all
convert: delegate failed `"ufraw-batch" --silent --create-id=also --out-type=png --out-depth=16 "--output=%u.png" "%i"' @ error/delegate.c/InvokeDelegate/1329.
convert: unable to open image `/var/tmp/magick-62951MgDuLgofUHxP.ppm': No such file or directory @ error/blob.c/OpenBlob/2675.
convert: no images defined `test2.png' @ error/convert.c/ConvertImageCommand/3212.
Re: NEF to JPG apache error.
Posted: 2015-03-27T11:29:17-07:00
by mogulman
This worked for me:
<?php
$file = "C:/pics/image003.jpg";
$fileNef = "C:/pics/image003.nef";
$cmd2 = 'convert "' . $fileNef . '" "' . $file . '"';
shell_exec ($cmd2);
?>
Re: NEF to JPG apache error.
Posted: 2015-04-02T20:39:08-07:00
by circleb
mogulman wrote:
$file = "C:/pics/image003.jpg";
$fileNef = "C:/pics/image003.nef";
$cmd2 = 'convert "' . $fileNef . '" "' . $file . '"';
shell_exec ($cmd2);
When I do that I get this error in my apache log:
Code: Select all
convert: delegate failed `"ufraw-batch" --silent --create-id=also --out-type=png --out-depth=16 "--output=%u.png" "%i"' @ error/delegate.c/InvokeDelegate/1329.
I've installed ufraw, dcraw and imagemagick with homebrew. WHen I run the commands via terminal they work great, but running them from a web page in apache gives me this error.
I also ran: `$ convert -list configure`, and `bzlib mpeg freetype jng jpeg lzma png xml zlib` are all that's listed as delegates.
I tried reinstalling imagemagick hoping that that would force it to pickup ufraw as a delegate, but nothing changed in the configure.xml file.
Re: NEF to JPG apache error.
Posted: 2015-04-02T20:55:05-07:00
by fmw42
Sounds like UFRAW either did not install properly, is missing some component or is installed at some other location than were IM expects it to be.
Did you install Imagemagick with Homebrew? If Homebrew is like MacPorts, any delegates get installed into a different locations from Imagemagick, if Imagemagick was installed manually or from binary and not with Homebrew/MacPorts, etc. Note that I know nothing about Homebrew and have never used it.
My standard procedure on my Mac OSX Snow Leopard is to install all the delegates needed using MacPorts and then install IM manually from source. That way I can keep current with IM. See my post at
viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202
See also
http://www.imagemagick.org/script/advan ... lation.php