blob: 20c4b1b0c89f78d69bd424925474b0b410c8f70f [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3% %
4% %
5% %
6% CCCC AAA L SSSSS %
7% C A A L SS %
8% C AAAAA L SSS %
9% C A A L SS %
10% CCCC A A LLLLL SSSSS %
11% %
12% %
cristy47b838c2009-09-19 16:09:30 +000013% Read/Write CALS Raster Group 1 Image Format %
cristy3ed852e2009-09-05 21:47:34 +000014% %
15% Software Design %
16% John Cristy %
17% July 1992 %
18% %
19% %
cristy16af1cb2009-12-11 21:38:29 +000020% Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization %
cristy3ed852e2009-09-05 21:47:34 +000021% dedicated to making software imaging solutions freely available. %
22% %
23% You may not use this file except in compliance with the License. You may %
24% obtain a copy of the License at %
25% %
26% http://www.imagemagick.org/script/license.php %
27% %
28% Unless required by applicable law or agreed to in writing, software %
29% distributed under the License is distributed on an "AS IS" BASIS, %
30% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
31% See the License for the specific language governing permissions and %
32% limitations under the License. %
33% %
34%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35%
36% The CALS raster format is a standard developed by the Computer Aided
37% Acquisition and Logistics Support (CALS) office of the United States
38% Department of Defense to standardize graphics data interchange for
39% electronic publishing, especially in the areas of technical graphics,
40% CAD/CAM, and image processing applications.
41%
42*/
43
44/*
45 Include declarations.
46*/
47#include "magick/studio.h"
48#include "magick/blob.h"
49#include "magick/blob-private.h"
50#include "magick/cache.h"
51#include "magick/colorspace.h"
52#include "magick/exception.h"
53#include "magick/exception-private.h"
cristy03117002009-09-19 02:10:44 +000054#include "magick/geometry.h"
cristy3ed852e2009-09-05 21:47:34 +000055#include "magick/image.h"
56#include "magick/image-private.h"
57#include "magick/list.h"
58#include "magick/magick.h"
59#include "magick/memory_.h"
60#include "magick/monitor.h"
61#include "magick/monitor-private.h"
cristy47b838c2009-09-19 16:09:30 +000062#include "magick/option.h"
cristy3ed852e2009-09-05 21:47:34 +000063#include "magick/quantum-private.h"
64#include "magick/resource_.h"
65#include "magick/static.h"
66#include "magick/string_.h"
67#include "magick/module.h"
68
cristy20a78b22010-04-05 01:22:12 +000069#if defined(MAGICKCORE_TIFF_DELEGATE)
cristy3ed852e2009-09-05 21:47:34 +000070/*
cristy03117002009-09-19 02:10:44 +000071 Forward declarations.
72*/
73static MagickBooleanType
74 WriteCALSImage(const ImageInfo *,Image *);
cristy20a78b22010-04-05 01:22:12 +000075#endif
cristy03117002009-09-19 02:10:44 +000076
77/*
cristy3ed852e2009-09-05 21:47:34 +000078%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79% %
80% %
81% %
82% I s C A L S %
83% %
84% %
85% %
86%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
87%
88% IsCALS() returns MagickTrue if the image format type, identified by the
cristy47b838c2009-09-19 16:09:30 +000089% magick string, is CALS Raster Group 1.
cristy3ed852e2009-09-05 21:47:34 +000090%
91% The format of the IsCALS method is:
92%
93% MagickBooleanType IsCALS(const unsigned char *magick,const size_t length)
94%
95% A description of each parameter follows:
96%
97% o magick: compare image format pattern against these bytes.
98%
99% o length: Specifies the length of the magick string.
100%
101*/
102static MagickBooleanType IsCALS(const unsigned char *magick,const size_t length)
103{
104 if (length < 128)
105 return(MagickFalse);
cristy03117002009-09-19 02:10:44 +0000106 if (LocaleNCompare((const char *) magick,"version: MIL-STD-1840",21) == 0)
cristy3ed852e2009-09-05 21:47:34 +0000107 return(MagickTrue);
cristy03117002009-09-19 02:10:44 +0000108 if (LocaleNCompare((const char *) magick,"srcdocid:",9) == 0)
cristy3ed852e2009-09-05 21:47:34 +0000109 return(MagickTrue);
cristy03117002009-09-19 02:10:44 +0000110 if (LocaleNCompare((const char *) magick,"rorient:",8) == 0)
cristy3ed852e2009-09-05 21:47:34 +0000111 return(MagickTrue);
112 return(MagickFalse);
113}
114
115/*
116%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
117% %
118% %
119% %
120% R e a d C A L S I m a g e %
121% %
122% %
123% %
124%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
125%
cristy47b838c2009-09-19 16:09:30 +0000126% ReadCALSImage() reads an CALS Raster Group 1 image format image file and
127% returns it. It allocates the memory necessary for the new Image structure
128% and returns a pointer to the new image.
cristy3ed852e2009-09-05 21:47:34 +0000129%
130% The format of the ReadCALSImage method is:
131%
132% Image *ReadCALSImage(const ImageInfo *image_info,
133% ExceptionInfo *exception)
134%
135% A description of each parameter follows:
136%
137% o image_info: the image info.
138%
139% o exception: return any errors or warnings in this structure.
140%
141*/
cristy2d6ccc32009-09-25 03:18:25 +0000142static Image *ReadCALSImage(const ImageInfo *image_info,
cristy3ed852e2009-09-05 21:47:34 +0000143 ExceptionInfo *exception)
144{
145 char
cristy2d6ccc32009-09-25 03:18:25 +0000146 filename[MaxTextExtent],
147 header[129],
148 message[MaxTextExtent];
cristy3ed852e2009-09-05 21:47:34 +0000149
150 FILE
151 *file;
152
153 Image
cristy2d6ccc32009-09-25 03:18:25 +0000154 *image;
cristy3ed852e2009-09-05 21:47:34 +0000155
156 ImageInfo
157 *read_info;
158
159 int
160 c,
161 unique_file;
162
cristy47b838c2009-09-19 16:09:30 +0000163 MagickBooleanType
164 status;
165
cristybb503372010-05-27 20:51:26 +0000166 register ssize_t
cristy47b838c2009-09-19 16:09:30 +0000167 i;
168
cristyf2faecf2010-05-28 19:19:36 +0000169 unsigned long
cristy3ed852e2009-09-05 21:47:34 +0000170 density,
171 direction,
172 height,
173 orientation,
174 pel_path,
175 type,
176 width;
177
178 /*
179 Open image file.
180 */
181 assert(image_info != (const ImageInfo *) NULL);
182 assert(image_info->signature == MagickSignature);
183 if (image_info->debug != MagickFalse)
184 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
185 image_info->filename);
186 assert(exception != (ExceptionInfo *) NULL);
187 assert(exception->signature == MagickSignature);
188 image=AcquireImage(image_info);
189 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
190 if (status == MagickFalse)
191 {
192 image=DestroyImageList(image);
193 return((Image *) NULL);
194 }
195 /*
196 Read CALS header.
197 */
198 (void) ResetMagickMemory(header,0,sizeof(header));
199 density=0;
200 direction=0;
201 orientation=1;
202 pel_path=0;
203 type=1;
204 width=0;
205 height=0;
206 for (i=0; i < 16; i++)
207 {
208 if (ReadBlob(image,128,(unsigned char *) header) != 128)
209 break;
210 switch (*header)
211 {
212 case 'R':
213 case 'r':
214 {
215 if (LocaleNCompare(header,"rdensty:",8) == 0)
216 {
cristy47b838c2009-09-19 16:09:30 +0000217 (void) sscanf(header+8,"%lu",&density);
cristy3ed852e2009-09-05 21:47:34 +0000218 break;
219 }
220 if (LocaleNCompare(header,"rpelcnt:",8) == 0)
221 {
cristy47b838c2009-09-19 16:09:30 +0000222 (void) sscanf(header+8,"%lu,%lu",&width,&height);
cristy3ed852e2009-09-05 21:47:34 +0000223 break;
224 }
225 if (LocaleNCompare(header,"rorient:",8) == 0)
226 {
cristy47b838c2009-09-19 16:09:30 +0000227 (void) sscanf(header+8,"%lu,%lu",&pel_path,&direction);
cristy3ed852e2009-09-05 21:47:34 +0000228 if (pel_path == 90)
229 orientation=5;
230 else
cristy2e68c0c2010-04-06 13:10:46 +0000231 if (pel_path == 180)
cristy3ed852e2009-09-05 21:47:34 +0000232 orientation=3;
233 else
234 if (pel_path == 270)
235 orientation=7;
236 if (direction == 90)
237 orientation++;
238 break;
239 }
240 if (LocaleNCompare(header,"rtype:",6) == 0)
241 {
cristy47b838c2009-09-19 16:09:30 +0000242 (void) sscanf(header+6,"%lu",&type);
cristy3ed852e2009-09-05 21:47:34 +0000243 break;
244 }
245 break;
246 }
247 }
248 }
cristy2d6ccc32009-09-25 03:18:25 +0000249 /*
250 Read CALS pixels.
251 */
252 file=(FILE *) NULL;
253 unique_file=AcquireUniqueFileResource(filename);
254 if (unique_file != -1)
255 file=fdopen(unique_file,"wb");
256 if ((unique_file == -1) || (file == (FILE *) NULL))
257 ThrowImageException(FileOpenError,"UnableToCreateTemporaryFile");
258 while ((c=ReadBlobByte(image)) != EOF)
259 (void) fputc(c,file);
260 (void) fclose(file);
261 (void) CloseBlob(image);
cristy3ed852e2009-09-05 21:47:34 +0000262 image=DestroyImage(image);
cristy2d6ccc32009-09-25 03:18:25 +0000263 read_info=CloneImageInfo(image_info);
264 SetImageInfoBlob(read_info,(void *) NULL,0);
265 (void) FormatMagickString(read_info->filename,MaxTextExtent,"group4:%.1024s",
266 filename);
267 (void) FormatMagickString(message,MaxTextExtent,"%lux%lu",width,height);
268 read_info->size=ConstantString(message);
269 (void) FormatMagickString(message,MaxTextExtent,"%lu",density);
270 read_info->density=ConstantString(message);
271 read_info->orientation=(OrientationType) orientation;
272 image=ReadImage(read_info,exception);
273 if (image != (Image *) NULL)
274 {
275 (void) CopyMagickString(image->filename,image_info->filename,
276 MaxTextExtent);
277 (void) CopyMagickString(image->magick_filename,image_info->filename,
278 MaxTextExtent);
279 (void) CopyMagickString(image->magick,"CALS",MaxTextExtent);
280 }
281 read_info=DestroyImageInfo(read_info);
282 (void) RelinquishUniqueFileResource(filename);
283 return(image);
cristy3ed852e2009-09-05 21:47:34 +0000284}
285
286/*
287%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288% %
289% %
290% %
291% R e g i s t e r C A L S I m a g e %
292% %
293% %
294% %
295%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
296%
cristy47b838c2009-09-19 16:09:30 +0000297% RegisterCALSImage() adds attributes for the CALS Raster Group 1 image file
298% image format to the list of supported formats. The attributes include the
299% image format tag, a method to read and/or write the format, whether the
300% format supports the saving of more than one frame to the same file or blob,
301% whether the format supports native in-memory I/O, and a brief description
302% of the format.
cristy3ed852e2009-09-05 21:47:34 +0000303%
304% The format of the RegisterCALSImage method is:
305%
cristybb503372010-05-27 20:51:26 +0000306% size_t RegisterCALSImage(void)
cristy3ed852e2009-09-05 21:47:34 +0000307%
308*/
cristybb503372010-05-27 20:51:26 +0000309ModuleExport size_t RegisterCALSImage(void)
cristy3ed852e2009-09-05 21:47:34 +0000310{
311 MagickInfo
312 *entry;
313
cristy9ca59552009-09-23 13:40:25 +0000314 static const char
315 *CALSDescription=
316 {
cristyc4a5dd22010-01-02 02:41:21 +0000317 "Continuous Acquisition and Life-cycle Support Type 1"
cristy9ca59552009-09-23 13:40:25 +0000318 },
319 *CALSNote=
320 {
321 "Specified in MIL-R-28002 and MIL-PRF-28002"
322 };
323
324 entry=SetMagickInfo("CAL");
cristy3ed852e2009-09-05 21:47:34 +0000325 entry->decoder=(DecodeImageHandler *) ReadCALSImage;
cristy9ca59552009-09-23 13:40:25 +0000326#if defined(MAGICKCORE_TIFF_DELEGATE)
cristy03117002009-09-19 02:10:44 +0000327 entry->encoder=(EncodeImageHandler *) WriteCALSImage;
cristy9ca59552009-09-23 13:40:25 +0000328#endif
cristy3ed852e2009-09-05 21:47:34 +0000329 entry->adjoin=MagickFalse;
330 entry->magick=(IsImageFormatHandler *) IsCALS;
cristy9ca59552009-09-23 13:40:25 +0000331 entry->description=ConstantString(CALSDescription);
332 entry->note=ConstantString(CALSNote);
333 entry->module=ConstantString("CALS");
334 (void) RegisterMagickInfo(entry);
335 entry=SetMagickInfo("CALS");
336 entry->decoder=(DecodeImageHandler *) ReadCALSImage;
337#if defined(MAGICKCORE_TIFF_DELEGATE)
338 entry->encoder=(EncodeImageHandler *) WriteCALSImage;
339#endif
340 entry->adjoin=MagickFalse;
341 entry->magick=(IsImageFormatHandler *) IsCALS;
342 entry->description=ConstantString(CALSDescription);
343 entry->note=ConstantString(CALSNote);
cristy3ed852e2009-09-05 21:47:34 +0000344 entry->module=ConstantString("CALS");
345 (void) RegisterMagickInfo(entry);
346 return(MagickImageCoderSignature);
347}
348
349/*
350%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
351% %
352% %
353% %
354% U n r e g i s t e r C A L S I m a g e %
355% %
356% %
357% %
358%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
359%
360% UnregisterCALSImage() removes format registrations made by the
361% CALS module from the list of supported formats.
362%
363% The format of the UnregisterCALSImage method is:
364%
365% UnregisterCALSImage(void)
366%
367*/
368ModuleExport void UnregisterCALSImage(void)
369{
cristy9ca59552009-09-23 13:40:25 +0000370 (void) UnregisterMagickInfo("CAL");
cristy3ed852e2009-09-05 21:47:34 +0000371 (void) UnregisterMagickInfo("CALS");
372}
cristy03117002009-09-19 02:10:44 +0000373
cristy316dac12009-12-07 17:19:28 +0000374#if defined(MAGICKCORE_TIFF_DELEGATE)
cristy03117002009-09-19 02:10:44 +0000375/*
376%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
377% %
378% %
379% %
380% W r i t e C A L S I m a g e %
381% %
382% %
383% %
384%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
385%
cristy47b838c2009-09-19 16:09:30 +0000386% WriteCALSImage() writes an image to a file in CALS Raster Group 1 image
387% format.
cristy03117002009-09-19 02:10:44 +0000388%
389% The format of the WriteCALSImage method is:
390%
391% MagickBooleanType WriteCALSImage(const ImageInfo *image_info,
392% Image *image)
393%
394% A description of each parameter follows.
395%
396% o image_info: the image info.
397%
398% o image: The image.
399%
400*/
401
cristy47b838c2009-09-19 16:09:30 +0000402static ssize_t WriteCALSRecord(Image *image,const char *data)
cristy03117002009-09-19 02:10:44 +0000403{
404 char
405 pad[128];
406
407 ssize_t
408 count;
409
410 register const char
411 *p;
412
cristybb503372010-05-27 20:51:26 +0000413 register ssize_t
cristy03117002009-09-19 02:10:44 +0000414 i;
415
416 i=0;
417 if (data != (const char *) NULL)
418 {
419 p=data;
420 for (i=0; (i < 128) && (p[i] != '\0'); i++);
cristy47b838c2009-09-19 16:09:30 +0000421 count=WriteBlob(image,(size_t) i,(const unsigned char *) data);
cristy03117002009-09-19 02:10:44 +0000422 }
423 if (i < 128)
424 {
cristy03117002009-09-19 02:10:44 +0000425 i=128-i;
cristy47b838c2009-09-19 16:09:30 +0000426 (void) ResetMagickMemory(pad,' ',(const size_t) i);
427 count=WriteBlob(image,(size_t) i,(const unsigned char *) pad);
cristy03117002009-09-19 02:10:44 +0000428 }
429 return(count);
430}
431
432static MagickBooleanType WriteCALSImage(const ImageInfo *image_info,
433 Image *image)
434{
435 char
cristy2d6ccc32009-09-25 03:18:25 +0000436 header[129];
437
438 Image
439 *group4_image;
440
441 ImageInfo
442 *write_info;
cristy03117002009-09-19 02:10:44 +0000443
444 MagickBooleanType
445 status;
446
cristybb503372010-05-27 20:51:26 +0000447 register ssize_t
cristy03117002009-09-19 02:10:44 +0000448 i;
449
450 ssize_t
451 count;
452
cristy2d6ccc32009-09-25 03:18:25 +0000453 size_t
454 length;
455
456 unsigned char
457 *group4;
458
cristybb503372010-05-27 20:51:26 +0000459 size_t
cristy03117002009-09-19 02:10:44 +0000460 density,
461 orient_x,
462 orient_y;
463
464 /*
465 Open output image file.
466 */
467 assert(image_info != (const ImageInfo *) NULL);
468 assert(image_info->signature == MagickSignature);
469 assert(image != (Image *) NULL);
470 assert(image->signature == MagickSignature);
471 if (image->debug != MagickFalse)
472 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
473 status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);
474 if (status == MagickFalse)
475 return(status);
476 /*
477 Create standard CALS header.
478 */
479 count=WriteCALSRecord(image,"srcdocid: NONE");
480 count=WriteCALSRecord(image,"dstdocid: NONE");
481 count=WriteCALSRecord(image,"txtfilid: NONE");
482 count=WriteCALSRecord(image,"figid: NONE");
483 count=WriteCALSRecord(image,"srcgph: NONE");
484 count=WriteCALSRecord(image,"docls: NONE");
485 count=WriteCALSRecord(image,"rtype: 1");
cristy43b2de02009-09-19 16:19:31 +0000486 orient_x=0;
487 orient_y=0;
cristy03117002009-09-19 02:10:44 +0000488 switch (image->orientation)
489 {
490 case TopRightOrientation:
491 {
492 orient_x=180;
493 orient_y=270;
494 break;
495 }
496 case BottomRightOrientation:
497 {
498 orient_x=180;
499 orient_y=90;
500 break;
501 }
502 case BottomLeftOrientation:
cristy43b2de02009-09-19 16:19:31 +0000503 {
cristy03117002009-09-19 02:10:44 +0000504 orient_y=90;
505 break;
cristy43b2de02009-09-19 16:19:31 +0000506 }
cristy03117002009-09-19 02:10:44 +0000507 case LeftTopOrientation:
508 {
509 orient_x=270;
cristy03117002009-09-19 02:10:44 +0000510 break;
511 }
512 case RightTopOrientation:
513 {
514 orient_x=270;
515 orient_y=180;
516 break;
517 }
518 case RightBottomOrientation:
519 {
520 orient_x=90;
521 orient_y=180;
522 break;
523 }
524 case LeftBottomOrientation:
525 {
526 orient_x=90;
cristy03117002009-09-19 02:10:44 +0000527 break;
528 }
529 default:
530 {
cristy03117002009-09-19 02:10:44 +0000531 orient_y=270;
532 }
533 }
cristy2d6ccc32009-09-25 03:18:25 +0000534 (void) FormatMagickString(header,MaxTextExtent,"rorient: %03ld,%03ld",
cristyf2faecf2010-05-28 19:19:36 +0000535 (long) orient_x,(long) orient_y);
cristy2d6ccc32009-09-25 03:18:25 +0000536 count=WriteCALSRecord(image,header);
537 (void) FormatMagickString(header,MaxTextExtent,"rpelcnt: %06lu,%06lu",
cristyf2faecf2010-05-28 19:19:36 +0000538 (unsigned long) image->columns,(unsigned long) image->rows);
cristy2d6ccc32009-09-25 03:18:25 +0000539 count=WriteCALSRecord(image,header);
cristy03117002009-09-19 02:10:44 +0000540 density=200;
541 if (image_info->density != (char *) NULL)
542 {
543 GeometryInfo
544 geometry_info;
545
546 (void) ParseGeometry(image_info->density,&geometry_info);
cristybb503372010-05-27 20:51:26 +0000547 density=(size_t) floor(geometry_info.rho+0.5);
cristy03117002009-09-19 02:10:44 +0000548 }
cristyf2faecf2010-05-28 19:19:36 +0000549 (void) FormatMagickString(header,MaxTextExtent,"rdensty: %04lu",
550 (unsigned long) density);
cristy2d6ccc32009-09-25 03:18:25 +0000551 count=WriteCALSRecord(image,header);
cristy03117002009-09-19 02:10:44 +0000552 count=WriteCALSRecord(image,"notes: NONE");
cristy2d6ccc32009-09-25 03:18:25 +0000553 (void) ResetMagickMemory(header,' ',128);
cristy03117002009-09-19 02:10:44 +0000554 for (i=0; i < 5; i++)
cristy2d6ccc32009-09-25 03:18:25 +0000555 (void) WriteBlob(image,128,(unsigned char *) header);
556 /*
557 Write CALS pixels.
558 */
559 write_info=CloneImageInfo(image_info);
560 (void) CopyMagickString(write_info->filename,"GROUP4:",MaxTextExtent);
561 (void) CopyMagickString(write_info->magick,"GROUP4",MaxTextExtent);
562 group4_image=CloneImage(image,0,0,MagickTrue,&image->exception);
563 if (group4_image == (Image *) NULL)
564 {
565 (void) CloseBlob(image);
566 return(MagickFalse);
567 }
568 group4=(unsigned char *) ImageToBlob(write_info,group4_image,&length,
569 &image->exception);
570 group4_image=DestroyImage(group4_image);
571 if (group4 == (unsigned char *) NULL)
572 {
573 (void) CloseBlob(image);
574 return(MagickFalse);
575 }
576 write_info=DestroyImageInfo(write_info);
577 if (WriteBlob(image,length,group4) != (ssize_t) length)
578 status=MagickFalse;
579 group4=(unsigned char *) RelinquishMagickMemory(group4);
cristy03117002009-09-19 02:10:44 +0000580 (void) CloseBlob(image);
581 return(status);
582}
cristy316dac12009-12-07 17:19:28 +0000583#endif