Page 1 of 1
Not responding when Convert Jpg(800Kb) to Tiff
Posted: 2013-10-01T03:56:13-07:00
by sireeshala
In my application i am using the image magick dlls to convert a Jpeg image to tiff.
The settings i have done to implement the conversion are "resize 7968x10968! density 300x300 quality 50 ".
for the "image.write" function call from dll there is no response . and the tiff image is not created for infinite time.
But when i am using the same settings with convert.exe directly from cmd prompt i am able to get the converted image.
Can any one help to fix this issue.
Thanks in Advance.
Re: Not responding when Convert Jpg(800Kb) to Tiff
Posted: 2013-10-01T10:05:45-07:00
by fmw42
Please identify your IM version, platform and exact full command.
"resize 7968x10968! density 300x300 quality 50 "
Note that all IM commands start with a minus sign
"-resize 7968x10968! -density 300x300 -quality 50 "
Also I am not sure -quality applies to an output Tiff unless your use jpg compression
Re: Not responding when Convert Jpg(800Kb) to Tiff
Posted: 2013-10-03T04:57:12-07:00
by sireeshala
Thanks for reply.
Version 6.8.7-10 and on Windows 7
the complete command line is "convert.exe in.jpg -resize 7968x10968! -density 300x300 -quality 50 -compress Group4 -type Bilevel Out.tiff"
After this command for infinite time out.tiff is not created.
This is the same case with lib files also .I am not able to get the result when i am setting the Object parameters to these values for my image.
Note :How to attach a sample Jpeg to this post?
Re: Not responding when Convert Jpg(800Kb) to Tiff
Posted: 2013-10-03T09:38:54-07:00
by fmw42
you may need to escape the ! as ^! or put the argument in double quotes.
To post an image, you need to upload it to some free image hosting web site (such as dropbox), and then post a link here back to the image.
Re: Not responding when Convert Jpg(800Kb) to Tiff
Posted: 2013-10-03T20:34:03-07:00
by snibgo
sireeshala wrote:for the "image.write" function call from dll there is no response . and the tiff image is not created for infinite time.
You need to provide the exact code you are using, and the input file that causes the problem.
You may have run out of memory.
Re: Not responding when Convert Jpg(800Kb) to Tiff
Posted: 2013-10-03T21:17:27-07:00
by sireeshala
Thanks for your quick response .
I have tried as you suggested.
convert.exe C:\Users\sireesha.lachhireddi\Desktop\imagemagic\rescale.jpg -resize 7968x10968^! -density 300x300 -quality 50 -compress Group4 -type Bilevel C:\Users\sireesha.lachhireddi\Desktop\imagemagic\rescale.tiff
And even like
convert.exe C:\Users\sireesha.lachhireddi\Desktop\imagemagic\rescale.jpg -resize 7968x10968 -density 300x300 -quality 50 -compress Group4 -type Bilevel C:\Users\sireesha.lachhireddi\Desktop\imagemagic\rescale.tiff
There is no change in the result .
The code i have used is
Code: Select all
string sResultSinglePage( "rescale.jpg");
Geometry gNewDensity(300,300);
Image image;
image.read( sResultSinglePage.c_str() );
image.resize("7968x10968");
image.density(gNewDensity);
image.quality(g_nJpegQuality);
image.magick("TIFF");
image.compressType(Group4Compression);
image.type(BilevelType);
image.write("rescale.tiff");
yes we may go out of memory but it should throw an exception or at least an error message.but there is no response from the function call.
I have uploaded my sample image in drop box at following link.
https://www.dropbox.com/s/3g3baikbnvomd5k/rescale.jpg
Re: Not responding when Convert Jpg(800Kb) to Tiff
Posted: 2013-10-03T22:15:36-07:00
by snibgo
Your command works on my Windows 7 computer, using 1.2 GB of memory, producing an entirely black result. The image is far better by also using "-contrast-stretch 5x80%".
Sorry, I can't advise on your code.
Re: Not responding when Convert Jpg(800Kb) to Tiff
Posted: 2013-10-04T01:34:08-07:00
by sireeshala
Is this command working ..?. are you working on 64 bit or 32 bit system?
Mine is windows 7 sp1 64 bit system with ram 8 GB.
I tried this on windows 2008 r2 with Ram 2GB i got an error message "no space exception".
https://www.dropbox.com/s/98455ufaj2bpz ... ws7_64.JPG
https://www.dropbox.com/s/zioncenmivxol ... 2K8_64.png
Re: Not responding when Convert Jpg(800Kb) to Tiff
Posted: 2013-10-04T01:59:28-07:00
by snibgo
I'm on Windows 7 with 4 GB RAM, 64 bit, IM v6.8.6-8.
Code: Select all
convert rescale.jpg -resize 7968x10968! -density 300x300 -quality 50 -compress Group4 -type Bilevel r2.tif
This completed in 1 minute 12 seconds, using about 1.2 GB of RAM. The result is entirely black.
As the result is black, changing the contrast at the end will have no effect. That has to be placed earlier in the process, eg:
Code: Select all
convert rescale.jpg -contrast-stretch 5x80% -resize 7968x10968! -density 300x300 -quality 50 -compress Group4 -type Bilevel r2.tif
The result is entirely legible.
I think Group4 compression is bilevel, so "-type bilevel" is superfluous. I don't think "-quality" is relevant for Group4 compression. So the command is simply:
Code: Select all
convert rescale.jpg -contrast-stretch 5x80% -resize 7968x10968! -density 300x300 -compress Group4 r3.tif
I don't know what you are trying to do. If you remove the resize, it runs much faster (6 seconds) and uses far less memory.