summaryrefslogtreecommitdiff
path: root/coders/pes.c
diff options
context:
space:
mode:
authorCristy <urban-warrior@imagemagick.org>2017-07-04 14:17:55 -0400
committerCristy <urban-warrior@imagemagick.org>2017-07-04 14:17:55 -0400
commit787ee25e9fb0e4e0509121342371d925fe5044f8 (patch)
tree5c446384a6cf21a2cd77a9bb141cdf0795429c4b /coders/pes.c
parent061de02095a56d438409c63f723f340b2d9d36c7 (diff)
downloadImageMagick-787ee25e9fb0e4e0509121342371d925fe5044f8.tar.gz
https://github.com/ImageMagick/ImageMagick/issues/537
Diffstat (limited to 'coders/pes.c')
-rw-r--r--coders/pes.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/coders/pes.c b/coders/pes.c
index a35a6eb88..e147da69a 100644
--- a/coders/pes.c
+++ b/coders/pes.c
@@ -534,7 +534,7 @@ static Image *ReadPESImage(const ImageInfo *image_info,ExceptionInfo *exception)
j=0;
delta_x=0;
delta_y=0;
- while (EOFBlob(image) != EOF)
+ while (EOFBlob(image) == MagickFalse)
{
x=ReadBlobByte(image);
y=ReadBlobByte(image);
@@ -620,6 +620,11 @@ static Image *ReadPESImage(const ImageInfo *image_info,ExceptionInfo *exception)
j++;
blocks[j].offset=(ssize_t) i;
number_blocks=(size_t) j;
+ image->columns=bounds.x2-bounds.x1;
+ image->rows=bounds.y2-bounds.y1;
+ status=SetImageExtent(image,image->columns,image->rows,exception);
+ if (status == MagickFalse)
+ return(DestroyImageList(image));
/*
Write stitches as SVG file.
*/
@@ -633,8 +638,8 @@ static Image *ReadPESImage(const ImageInfo *image_info,ExceptionInfo *exception)
(void) FormatLocaleFile(file,"<svg xmlns=\"http://www.w3.org/2000/svg\" "
"xlink=\"http://www.w3.org/1999/xlink\" "
"ev=\"http://www.w3.org/2001/xml-events\" version=\"1.1\" "
- "baseProfile=\"full\" width=\"%g\" height=\"%g\">\n",bounds.x2-bounds.x1,
- bounds.y2-bounds.y1);
+ "baseProfile=\"full\" width=\"%g\" height=\"%g\">\n",(double)
+ image->columns,(double) image->rows);
for (i=0; i < (ssize_t) number_blocks; i++)
{
offset=blocks[i].offset;