General Category > General Discussion
Error when generating logos in PDF format
hjb2004:
Hi Xiang-Jun,
When I run these commands:
cd examples/MatrixREDUCE/spellman-alpha
sh commandline.sh
LogoGenerator -file=results/psam_001.xml -format=pdf
I get the following error:
GPL Ghostscript 9.19:
ERROR:
Can't set GraphicsAlphaBits or TextAlphaBits with a vector device.
Unrecoverable error: rangecheck in .putdeviceprops
system('gs -sOutputFile=./psam_001.pdf \
-sDEVICE=pdfwrite \
-dPDFSETTINGS=/printer \
-dEmbedAllFonts=true \
-dDEVICEWIDTHPOINTS=340 \
-dDEVICEHEIGHTPOINTS=213 \
-q -r96 -dTextAlphaBits=4 -dSAFER -dBATCH -dNOPAUSE \
./temp_logo.eps
') returns nonzero (65280)
The error seems to be triggered by the "-dTextAlphaBits=4" option. When I run "gs" manually without it, it work fine.
Seems that this is a known problem with more recent versions of "gs". I use version 9.19 on a Mac OS 10.11.6.
Thanks,
Harmen
xiangjun:
Hi Harmen,
Thanks for posting on the Forum!
Yes, I can reproduce the error message with regard to generating the logos in PDF format. It is indeed due to the Ghostscript "-dTextAlphaBits=4" option you reported. I am using Ghostscript 9.21.
I remember taking the "-dTextAlphaBits=4" option from reading on the docs/examples somewhere. Now that we know the problem, we have the following options to go:
* Simply remove the "-dTextAlphaBits=4" option from the system call.
* Or we can remove the support of the PDF output format (from the documentation).
While we are here, I'd also want to remove the largely out-of-date GIF output format. By doing so, we also get rid of the dependency on the convert from ImageMagick.
What's your take? Please let me know, and I will update and code for a new release late tonight (or tomorrow).
Xiang-Jun
hjb2004:
Hi Xiang-Jun,
PDF support seems important to keep, and removing the option "-dTextAlphaBits=4" from config/pkg_settings.cfg completely solved the problem for me for this format, so I can continue with what I was doing now.
However, I agree that it will be best to discontinue GIF support. On my Mac at least, "convert" is not installed by default, and indeed GIF generation with "-format=gif" does not work:
$ LogoGenerator -file=results/psam_001.xml -format=gif
sh: line 6: convert: command not found
system('gs -sOutputFile=- \
-sDEVICE=png16m \
-dDEVICEWIDTHPOINTS=340 \
-dDEVICEHEIGHTPOINTS=213 \
-q -r96 -dSAFER -dBATCH -dNOPAUSE \
./temp_logo.eps \
| convert png:- ./psam_001.gif
') returns nonzero (32512)
Thanks for the quick response!
Harmen
xiangjun:
Hi Harmen,
Thanks for your quick feedback.
I'll update the software code with 'gif' output removed, but keep the PDF option. A new release will be made available on the download page late tonight.
Best regards,
Xiang-Jun
xiangjun:
As a followup, the REDUCE Suite has been updated to v2.2.4-2017nov16. The LogoGenerator bug for PDF output has been fixed. The obsolete GIF output has been removed to avoid a dependency on the convert program from ImageMagick. The default PNG format is the choice for use with HTMLSummary-generated webpage. The LogoGenerator documentation has been also revised.
Some examples:
--- Code: Ruby ---# By default, the output is in PNG formatLogoGenerator -file=$REDUCE_SUITE/data/formats/psam_ex.dat -logo=sample.png# Using the -format=pdf option for PDF outputLogoGenerator -file=$REDUCE_SUITE/data/formats/psam_ex.dat -logo=sample.pdf -format=pdf# Output in the raw EPS format with -format=epsLogoGenerator -file=$REDUCE_SUITE/data/formats/psam_ex.dat -logo=sample.eps -format=eps
The LogoGenerator utility in the REDUCE Suite is a general purpose, robust logo generator of DNA or RNA base sequences. It creates a logo in the vector EPS format, which can be easily converted to other vector or raster image format using numerous third-party tools. Internally, LogoGenerator takes advantage of the widely available gs program (Ghostscript).
It is worth noting that on Mac OS X, the preview program can directly read LogoGenerator-created EPS file and convert it to PDF format. On Linux and Windows, the situation should be similar.
Xiang-Jun
Navigation
[0] Message Index
[#] Next page
Go to full version