Is there a size limit on the textcleaner script?
I have the script working fine on smaller images around 1.9Mb still works. But when I use filesizes like 3.4 MB it doesn't seem to work.
On another server the larger images are processed just fine so perhaps there is a setting I need to do on the server to be able to process larger files?
On an image of 1.9 MB it just generates the test:
Code: Select all
/var/www/CENCORED :)/web/textcleaner -s 3 app_images/ticket_1423476443139.jpg ./app_images/gens/test.jpg
Code: Select all
root@CENCORED:/var/www/CENCORED/web# /var/www/CENCORED/web/textcleaner -s 3 app_images/ticket_1423765951755.jpg ./app_images/gens/testjimmy.jpg
convert: magick/blob.c:4020: WriteBlob: Assertion `data != (const unsigned char *) ((void *)0)' failed.
/var/www/CENCORED/web/textcleaner: line 397: 10567 Aborted (core dumped) convert -quiet "$infile" +repage "$tmpA1"
--- FILE app_images/ticket_1423765951755.jpg NOT READABLE OR HAS ZERO SIZE ---
textcleaner:
USAGE: textcleaner [-r rotate] [-l layout] [-c cropoff] [-g] [-e enhance ] [-f filtersize] [-o offset] [-u] [-t threshold] [-s sharpamt] [-s saturation] [-a adaptblur] [-T] [-p padamt] [-b bgcolor] infile outfile
USAGE: textcleaner [-help]
OPTIONS:
-r rotate rotate image 90 degrees in direction specified if
aspect ratio does not match layout; options are cw
(or clockwise), ccw (or counterclockwise) and n
(or none); default=none or no rotation
-l layout desired layout; options are p (or portrait) or
l (or landscape); default=portrait
-c cropoff image cropping offsets after potential rotate 90;
choices: one, two or four non-negative integer comma
separated values; one value will crop all around;
two values will crop at left/right,top/bottom;
four values will crop left,top,right,bottom
-g convert document to grayscale before enhancing
-e enhance enhance image brightness before cleaning;
choices are: none, stretch or normalize;
default=stretch
-f filtersize size of filter used to clean background;
integer>0; default=15
-o offset offset of filter in percent used to reduce noise;
integer>=0; default=5
-u unrotate image; cannot unrotate more than
about 5 degrees
-t threshold text smoothing threshold; 0<=threshold<=100;
nominal value is about 50; default is no smoothing
-s sharpamt sharpening amount in pixels; float>=0;
nominal about 1; default=0
-S saturation color saturation expressed as percent; integer>=0;
only applicable if -g not set; default=100 (no change)
-a adaptblur alternate text smoothing using adaptive blur;
floats>=0; default=0 (no smoothing)
-T trim background around outer part of image
-p padamt border pad amount around outer part of image;
integer>=0; default=0
-b bgcolor desired color for background; default=white
Code: Select all
# convert -version
Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
Also the error is thrown instantaneously so I assume this is not due to running out of memory or something like that.
What could be causing this? Any thoughts?