in reply to How can I use a CGI script to return an image?
It worked perfectly on a 2K gif image, but however with larger images of 5K or so, only about half of the image shows up. I tried to change the buffer value but all in vain. Any help is greatly appreciated.open IMAGE, "/path/to/image.jpg"; #assume is a jpeg... my ($image, $buff); while(read IMAGE, $buff, 1024) { $image .= $buff; } close IMAGE; print "Content-type: image/jpeg\n\n"; print $image;
Originally posted as a Categorized Answer.
|
|---|