Page 1 of 2
no output using crop
Posted: 2017-04-24T23:56:01-07:00
by laser-axel
Hello,
I am using image magick within cygwin (Version: ImageMagick 6.9.5-7 Q16 x86_64 2016-08-27) to convert the image data to text output. The text output is parsed by some awk script to do some calculations.
It seems suddenly (poosibly some update) the script stopped working because image magick does not create any output. I tracked down the problem that image magick does not produce any output when using -crop.
==================
$ identify bad_pos_P1.png
bad_pos_P1.png PNG 1440x900 1440x900+0+0 8-bit sRGB 564KB 0.000u 0:00.030
$ convert.exe bad_pos_P1.png test_do-noting.png
$ convert.exe bad_pos_P1.png -crop 500x500+100+100 test_crop.png
$ ls -l test*
-rw-rw-r--+ 1 aheinrici Domain Users 469608 25. Apr 08:47 test_do-noting.png
$
===================
There is no file test_crop.png. There is no output when the output file is "text:-". There is no output when the input image is .jpg.
I have absolutely no clue what is goint on?
Re: no output using crop
Posted: 2017-04-25T03:52:37-07:00
by snibgo
bad_pos_P1.png is 1440x900+0+0 but:
laser-axel wrote:$ convert.exe bad_pos_P1.png -crop 500x500+100+100 test_crop.png
There is no file test_crop.png.
That is very strange. Do you get an error message? Does the problem occur with all inputs, or just this file? If just this file, then it may be corrupt.
Try:
Code: Select all
convert.exe -size 1440x900 xc: info:
convert.exe -size 1440x900 xc: -crop 500x500+100+100 info:
convert.exe -size 1440x900 xc: t1.png
convert.exe -size 1440x900 xc: -crop 500x500+100+100 t2.png
Re: no output using crop
Posted: 2017-04-25T06:11:55-07:00
by laser-axel
bad_pos_P1.png is 1440x900+0+0 but:
Of cousre the original image is bigger. That is the purpose of cropping
This is happening with all images. And image magick can convert the file bad_pos_P1.png to jpg. There doesn't seem to be anything wrong with that file.
~/test
$ convert.exe -size 1440x900 xc: info:
xc: XC 1440x900 1440x900+0+0 16-bit sRGB 0.000u 0:00.030
~/test
$ convert.exe -size 1440x900 xc: -crop 500x500+100+100 info:
~/test
$ convert.exe -size 1440x900 xc: t1.png
~/test
$ convert.exe -size 1440x900 xc: -crop 500x500+100+100 t2.png
~/test
$ ls
No output is created.
Re: no output using crop
Posted: 2017-04-25T06:22:31-07:00
by snibgo
So, this...
Code: Select all
$ convert.exe -size 1440x900 xc: t1.png
... didn't work either? Something is badly wrong. Sorry, I have no idea what. I suggest you re-install ImageMagick.
Re: no output using crop
Posted: 2017-04-25T07:33:08-07:00
by laser-axel
... didn't work either? Something is badly wrong. Sorry, I have no idea what. I suggest you re-install ImageMagick.
The execution time also suggests that imagemagick is somehow crashing. Converting a big jpg to png takes 2-3 seconds. With any resize or crop the convert command immediately finishes.
I just upgraded with the cygwin installer from 6.9.5.7-1 to 6.9.5.7-2. No change in the behavior.
Re: no output using crop
Posted: 2017-04-25T07:45:52-07:00
by snibgo
You are running the commands from Cygwin's bash, correct? Then try them from Windows CMD.
Re: no output using crop
Posted: 2017-04-26T14:29:09-07:00
by laser-axel
I'm using convert from cygwins bash. Sorry, I might appera as a total noob, but I am not sure what is meant by "from Windows CMD".
convert in cygwin's bash is executing /usr/bin/convert.exe. In Windows CMD convert<RET> will execute c:\windows\system32\convert.exe, which is a conversion tool from FAT to NTFS.
Do you want me to use a windows-installation of image magick?
Re: no output using crop
Posted: 2017-04-26T14:45:12-07:00
by fmw42
Is it possible that you are trying to use the Windows convert.exe rather than the ImageMagick convert.exe?
Re: no output using crop
Posted: 2017-04-26T14:58:52-07:00
by snibgo
On my Windows computer with Cygwin, I install Windows installations of ImageMagick. This works fine, running from Windows CMD or bash. I don't install IM from the Cygwin site, which you seem to have done.
I don't know why IM doesn't work for you. Sorry.
Re: no output using crop
Posted: 2017-05-11T23:45:49-07:00
by laser-axel
Finally I have Image-Magick for Windows installed.
Following behaviour in cygwin:
$ /cygdrive/c/Programme/ImageMagick-7.0.5-Q16/convert.exe z06.png -crop 500x500+200+200 test.jpg
is working
$ convert z06.png -crop 500x500+200+200 test.jpg
does not generate any output
I think it is safe to make the statement, there is something wrong with the cygwin installation/ the cygwin-imageMagick-package.
Although I think the solution is a little odd I can fix my scripts be changing any "convert" to "/cygdrive/c/Programme/ImageMagick-7.0.5-Q16/convert.exe"
Re: no output using crop
Posted: 2017-05-12T00:02:45-07:00
by fmw42
try adding +repage after -crop ....
Re: no output using crop
Posted: 2017-05-12T00:34:27-07:00
by snibgo
laser-axel wrote:$ convert z06.png -crop 500x500+200+200 test.jpg
does not generate any output
No output at all? Not even an error message? What happens with:
Re: no output using crop
Posted: 2017-05-29T23:12:29-07:00
by laser-axel
Code: Select all
$ convert -version
Version: ImageMagick 6.9.5-7 Q16 x86_64 2016-12-23 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC OpenMP
Delegates (built-in): autotrace bzlib cairo fftw fontconfig fpx freetype gslib jbig jng jp2 jpeg lcms lzma pangocairo png ps rsvg tiff webp x xml zlib
I also tried with the option "-debug All".
With the crop option this is the last entry in the debug output:
Code: Select all
2017-05-30T07:56:51+02:00 0:00.126 0.125u 6.9.5 Cache convert[2916]: cache.c/OpenPixelCache/3870/Cache
open z06.png[0] (Heap Memory, 500x500 1.907MiB)
All the debug-output on the further actions is missing. After that nothing happens. No error message.
Re: no output using crop
Posted: 2017-05-29T23:28:11-07:00
by fmw42
try
convert z06.png -crop 500x500+200+200 +repage test.jpg
Be sure your convert is the ImageMagick convert and not the Windows convert. Also be sure your input and output images are in your working directory from which you issued the command line. Be sure you have read and write permissions for those files and the directory and execute permissions to run the command.
Be sure your install has both libjped and limping installed.
convert -list version, should list them. Or convert -list format will tell you which versions you have.
Re: no output using crop
Posted: 2017-05-29T23:31:39-07:00
by snibgo
You seem to have two versions installed: 6.9.5-7 and 7.0.5-something. I don't know how to do that with Cygwin.
I suggest you remove both installations, then install just one of them.