ImageMagic gives ' delegate failed `'ufraw-batch' ' - imagemagick

{ Error: Command failed: identify: delegate failed `'ufraw-batch' --silent --create-id=also --out-type=png --out-depth=16 '--output=%u.png' '%i'' # error/delegate.c/InvokeDelegate/1919.
identify: unable to open image `/tmp/magick-53080Z_JGYvtuPOl8.ppm': No such file or directory # error/blob.c/OpenBlob/2841.
I got an issue while working with ImageMagick in my node application I did the search but can't get the proper solution for my problem.

Edit: ufraw is no longer maintained, so use at your own risk and see dcraw alternative lower down.
You need to install 'ufraw-batch'
sudo apt-get install ufraw-batch
If this does not work, as it did for me. I got a "Segmentation fault (core dumped)"
This seems to be common problem with ufraw: https://sourceforge.net/p/ufraw/bugs/
It does not seem to get update much anymore, at least not in the main repos.
Converting RAW image into other types of image you can use DCRaw (it is also used by UFRaw).
Here is an example to convert a .cr2 image to a .png:
dcraw -c -w "./IMG_1.CR2" | pnmtopng > "./IMG_1.png";

Macos:
brew install ufraw
Solved it for me

Related

textclips in moviepy on google colab (imagemagick error)

I'm trying to add text to a moviepy video, but I'm having trouble getting imagemagick to work on google colab.
The code:
!apt install imagemagick
from moviepy.editor import TextClip
txtClip = TextClip('Cool effect',color='white',
font="Amiri-Bold", kerning = 5, fontsize=100)
The error:
OSError: MoviePy Error: creation of None failed because
of the following error:
[Errno 2] No such file or directory: 'unset': 'unset'.
.This error can be due to the fact that ImageMagick is
not installed on your computer, or (for Windows users)
that you didn't specify the path to the ImageMagick
binary in file conf.py, or that the path you specified
is incorrect
research:
Not able to add Text Clip in Moviepy. Getting error related to Imagemagic
Getting error about ImageMagick With Python/MoviePy when I try add text clip
Attempt at resolving the issue:
Based on the error message, I started looking for the conf.py file. I ran
!find / -type d -name "conf.py" but none of the files returned seemed to be under the subdirectory of imagemagick.
I also modified the policy.xml file under /etc/ImageMagick-6 by commenting out the line <!--<policy domain="path" rights="none" pattern="#*"/>--> but to no avail seemingly.
Any ideas??
I had the same issue. Check if this work for you: Install with:
!apt install
imagemagick
Then to fix the issue that it thinks ImageMagick is not installed use this:
!cat /etc/ImageMagick-6/policy.xml | sed 's/none/read,write/g'>
/etc/ImageMagick-6/policy.xml

Eigen version static assertion fail in binary version

I installed drake binary in my ubuntu 16.04 xenial by
curl -o drake.tar.gz https://drake-packages.csail.mit.edu/drake/continuous/drake-latest-xenial.tar.gz
sudo tar -xvzf drake.tar.gz -C /opt
And I find_package(drake) in my cmake and try to do optimization.
But I got the following error
/opt/drake/include/drake/common/autodiff.h:15:1: error: static assertion failed: Drake requires Eigen >= v3.3.3.
static_assert(EIGEN_VERSION_AT_LEAST(3, 3, 3)
and
/opt/drake/include/drake/common/autodiffxd.h:232:69: error: ‘MakeAutoDiffScalar’ was not declared in this scope
return MakeAutoDiffScalar(m_value * other, m_derivatives * other);
I think I am including right Eigen which is located in
/opt/drake/include/eigen3.
How could I fix it?
By the way in the Mac, it works well with the same code.
It may be that you've (either directly or indirectly) called find_package(Eigen) before you did so on Drake, in which case CMake may be finding your system Eigen rather than the Drake-provided version; this is noted here (sorry that it's not yet in a more obvious location):
https://github.com/RobotLocomotion/drake-shambhala/tree/b3d7804/drake_cmake_installed/src/pcl#eigen
If you do find_package(drake) first, then it should allow find_package(Eigen) to work later on.
If that doesn't work, could you post a link to your code in a GitHub repository, or can you make a minimal reproduction issue?

how to convert Pdf to image via imagemagick command?

I am using following environment:
Ubunut : 11.0 (virtual machine)
Imagemagick : ImageMagick-6.9.3-7
I have execut following command:
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar xzvf ImageMagick.tar.gz
ls
cd ImageMagick<version number here>/
./configure
make clean
make
sudo make install
ldconfig /usr/local/lib
After executing below command:
make check
40 test case 39 pass only 1 is fail (FAIL: tests/wandtest.tap 1)
Now i want to convert pdf file to jpg via command:
convert test.pdf test.jpg
convert: no decode delegate for this image format PNG' # error/constitute.c/ReadImage/501.
convert: no images definedtest.jpg' # error/convert.c/ConvertImageCommand/3252
convert test.pdf test.png
convert: no decode delegate for this image format PNG' # error/constitute.c/ReadImage/501.
convert: no images definedtest.png' # error/convert.c/ConvertImageCommand/3252.
anyone can suggest me how can i do ?
ImageMagick uses assorted external libraries to do its dirty work as far as input and output handling goes for various formats. In your case:
For reading PDFs, you need to have Ghostscript installed. Also it needs to be in your path as gs in order to work, so don't use that for some other shell alias. For more details see: https://superuser.com/q/819277/33767
For writing PNGs you'll need libpng.
Once those things are on your system (and in the case you compiled IM yourself, on your system at the time of compile) you should be golden.
It may be that the issue is not with the writing but with the reading of the PDF itself.
Check the ImageMagick policy.xml.
sudo nano /etc/ImageMagick-6/policy.xml
Find the PDF and change to this:
<policy domain="coder" rights="read|write" pattern="PDF" />
This solved for me.
Same problem. Solved it with:
apt-get -y install ghostscript

Showing [hello-world.upload] Error 2 in contiki

I am trying to upload hello-world in Micaz using Contiki.
I followed these steps
user#instant-contiki:~$ cd contiki/examples/hello-world
user#instant-contiki:~/contiki/examples/hello-world$ make TARGET=micaz hello-world
CC hello-world.c
LD hello-world.micaz
rm hello-world.co
user#instant-contiki:~/contiki/examples/hello-world$ make TARGET=micaz savetarget
saving Makefile.target
Finally while uploading I got the below error
user#instant-contiki:~/contiki/examples/hello-world$ make hello-world.upload
using saved target 'micaz'
avr-objcopy -O srec hello-world.micaz hello-world.srec
uisp -dprog=mib510 -dserial=/dev/ttyS0 -dpart=ATmega128 --wr_fuse_h=0xd1 --wr_fuse_e=ff --erase --upload if=hello-world.srec --verify
Error: Permission denied
-> /dev/ttyS0
make: *** [hello-world.upload] Error 1
rm hello-world.srec
I have seen many Stackoverflow questions regarding the same .
But those workaround is not solving my issues.
Am I doing anything wrong.
Please Suggest.
First of all, the problem is about permission.
Try "sudo make hello-world.upload"
And if you use Instant contiki 2.7 and it is your first time compiling with Micaz,
you may have another problem about "make: uisp: Command not found"
Then, refer following link.
http://iotnet.blogspot.kr/2014/07/contiki-micaz-2-uisp-command-not-found.html

image::magick not installing with cpan in perl v5.14.2 from dwimperl

I am attempting to rebuild my development/test environment on a new laptop running windows7 32 bit. imageMagick is one of the modules I had installed in an (ancient) version on my old laptop. I have downloaded and installed perl from dwimperl, which is v5.14.2 and had a couple modules install, and several did not.
cpanm Image::Magick - failed
cpanm DB_File - failed
cpanm Time::HiRes - failed
I searched around and found a discussion on magick failing to install on v5.12, but couldn't tell if that was supposed to have been fixed, or if I need to attempt to recreate the fix discussed for 5.12
should I try installing perl from Strawberry? looks like it is a little newer v5.18 ?
is there something I can tweak and re-run cpan installs?
I installed the binaries from imagemagick, from Link first, then cpan again, and cpan still fails....
This is the top part of the build log down to where it really goes south and starts kicking out errors:
cpanm (App::cpanminus) 1.6941 on perl 5.014002 built for MSWin32-x86-multi-thread
Work directory is C:\Users\dtbaker/.cpanm/work/1377281741.8420
You have make C:\Dwimperl\c\bin\dmake.exe
You have LWP 6.03
Falling back to Archive::Tar 1.80
Searching Image::Magick on cpanmetadb ...
--> Working on Image::Magick
Fetching http://www.cpan.org/authors/id/J/JC/JCRISTY/PerlMagick-6.86.tar.gz
-> OK
Unpacking PerlMagick-6.86.tar.gz
Entering PerlMagick-6.86
META.yml/json not found. Creating skelton for it.
Configuring PerlMagick-6.86
Running Makefile.PL
################################### WARNING! ###################################
# It seems that you are trying to install Perl::Magick on a MS Windows box with
# perl + gcc compiler (e.g. strawberry perl), however we cannot find ImageMagick
# binaries installed on your system.
#
# Please check the following prerequisites:
#
# 1) You need to have installed ImageMagick Windows binaries from
# http://www.imagemagick.org/script/binary-releases.php#windows
#
# 2) We only support dynamic (DLL) ImageMagick binaries
# note: it is not possible to mix 32/64-bit binaries of perl and ImageMagick
#
# 3) During installation select that you want to install ImageMagick's
# development files (libraries+headers)
#
# 4) You also need to have ImageMagick's directory in your PATH
# note: we are checking the presence of convert.exe and/or identify.exe tools
#
# 5) You might need Visual C++ Redistributable Package installed on your system
# see instructions on ImageMagick's Binary Release webpage
#
# We are gonna continue, but chances for successful build are very low!
################################################################################
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lMagickCore-6.Q16
Writing Makefile for Image::Magick
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.62)
Building and testing Image-Magick-6.86
cp Magick.pm blib\lib\Image\Magick.pm
AutoSplitting blib\lib\Image\Magick.pm (blib\lib\auto\Image\Magick)
C:\Dwimperl\perl\bin\perl.exe C:\Dwimperl\perl\lib\ExtUtils\xsubpp -typemap C:\Dwimperl\perl\lib\ExtUtils\typemap -typemap typemap Magick.xs > Magick.xsc && C:\Dwimperl\perl\bin\perl.exe -MExtUtils::Command -e mv -- Magick.xsc Magick.c
gcc -c -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"6.86\" -DXS_VERSION=\"6.86\" "-IC:\Dwimperl\perl\lib\CORE" -D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c
Magick.xs:60:31: error: magick/MagickCore.h: No such file or directory
Magick.xs:167: error: expected specifier-qualifier-list before 'MagickRealType'
Magick.xs:188: error: expected specifier-qualifier-list before 'ImageInfo'
Magick.xs:210: error: 'MagickNoiseOptions' undeclared here (not in a function)
however we cannot find ImageMagick binaries installed on your system.
Is ImageMagick is in your path, as recommanded in the 4) point? Open cmd.exe and type convert -v or convert.exe -v. If you don't see informations about Image Magick (Windows have a built-in convert command), it is very likely you have to add it to your path.
You also have to check points 1), 3), and 5). After that try again to run installation process through cpanm.
Trying to install for Citrus Perl, I discovered on debugging through the Perl part of the install that the mingw64 install had not included 'pexports.exe'. Downloading that from https://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/
and placing it in the mingw64 directory was necessary to solve the problem of a long list of library export symbols not found.
Prior to that I had also set the environment variables CPATH, C_INCLUDE_PATH, and CPLUS_INCLUDE_PATH to point to the "include" directory of the ImageMagick install include directory in C:\Program Files (x86). (When you install ImageMagick you should check the box to install also for Strawberry Perl.)

Resources