image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickCoreSignature);
- if (LocaleNCompare(image_info->filename,"data:",5) == 0)
- return(ReadInlineImage(image_info,image_info->filename,exception));
+ if (LocaleCompare(image_info->magick,"DATA") == 0)
+ {
+ char
+ *filename;
+
+ Image
+ *data_image;
+
+ filename=AcquireString("data:");
+ (void) ConcatenateMagickString(filename,image_info->filename,
+ MagickPathExtent);
+ data_image=ReadInlineImage(image_info,filename,exception);
+ filename=DestroyString(filename);
+ return(data_image);
+ }
image=AcquireImage(image_info,exception);
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
MagickInfo
*entry;
+ entry=AcquireMagickInfo("DATA","INLINE","Base64-encoded inline images");
+ entry->decoder=(DecodeImageHandler *) ReadINLINEImage;
+ entry->encoder=(EncodeImageHandler *) WriteINLINEImage;
+ entry->format_type=ImplicitFormatType;
+ (void) RegisterMagickInfo(entry);
entry=AcquireMagickInfo("INLINE","INLINE","Base64-encoded inline images");
entry->decoder=(DecodeImageHandler *) ReadINLINEImage;
entry->encoder=(EncodeImageHandler *) WriteINLINEImage;
ModuleExport void UnregisterINLINEImage(void)
{
(void) UnregisterMagickInfo("INLINE");
+ (void) UnregisterMagickInfo("DATA");
}
\f
/*
if ((magick_info == (const MagickInfo *) NULL) ||
(GetMagickMimeType(magick_info) == (const char *) NULL))
ThrowWriterException(CorruptImageError,"ImageTypeNotSupported");
- (void) CopyMagickString(image->filename,write_info->filename,MagickPathExtent);
+ (void) CopyMagickString(image->filename,write_info->filename,
+ MagickPathExtent);
blob_length=2048;
write_image=CloneImage(image,0,0,MagickTrue,exception);
if (write_image == (Image *) NULL)
/*
Write MIFF header.
*/
- (void) WriteBlobString(image,"id=ImageMagick version=1.0\n");
+ (void) WriteBlobString(image,"id=ImageMagick version=2.0\n");
(void) FormatLocaleString(buffer,MagickPathExtent,
"class=%s colors=%.20g alpha-trait=%s\n",CommandOptionToMnemonic(
MagickClassOptions,image->storage_class),(double) image->colors,
CommandOptionToMnemonic(MagickPixelTraitOptions,(ssize_t)
image->alpha_trait));
(void) WriteBlobString(image,buffer);
- (void) FormatLocaleString(buffer,MagickPathExtent,"columns=%.20g rows=%.20g "
- "depth=%.20g\n",(double) image->columns,(double) image->rows,(double)
- image->depth);
+ (void) FormatLocaleString(buffer,MagickPathExtent,
+ "columns=%.20g rows=%.20g depth=%.20g\n",(double) image->columns,
+ (double) image->rows,(double) image->depth);
(void) WriteBlobString(image,buffer);
if (image->type != UndefinedType)
{
}
if (image->intensity != UndefinedPixelIntensityMethod)
{
- (void) FormatLocaleString(buffer,MagickPathExtent,"pixel-intensity=%s\n",
- CommandOptionToMnemonic(MagickPixelIntensityOptions,
- image->intensity));
+ (void) FormatLocaleString(buffer,MagickPathExtent,
+ "pixel-intensity=%s\n",CommandOptionToMnemonic(
+ MagickPixelIntensityOptions,image->intensity));
(void) WriteBlobString(image,buffer);
}
if (image->endian != UndefinedEndian)
}
if ((image->tile_offset.x != 0) || (image->tile_offset.y != 0))
{
- (void) FormatLocaleString(buffer,MagickPathExtent,"tile-offset=%+ld%+ld\n",
- (long) image->tile_offset.x,(long) image->tile_offset.y);
+ (void) FormatLocaleString(buffer,MagickPathExtent,
+ "tile-offset=%+ld%+ld\n",(long) image->tile_offset.x,(long)
+ image->tile_offset.y);
(void) WriteBlobString(image,buffer);
}
if ((GetNextImageInList(image) != (Image *) NULL) ||
}
if (image->iterations != 0)
{
- (void) FormatLocaleString(buffer,MagickPathExtent,"iterations=%.20g\n",
- (double) image->iterations);
+ (void) FormatLocaleString(buffer,MagickPathExtent,
+ "iterations=%.20g\n",(double) image->iterations);
(void) WriteBlobString(image,buffer);
}
if (image->delay != 0)
}
if (image->rendering_intent != UndefinedIntent)
{
- (void) FormatLocaleString(buffer,MagickPathExtent,"rendering-intent=%s\n",
- CommandOptionToMnemonic(MagickIntentOptions,image->rendering_intent));
+ (void) FormatLocaleString(buffer,MagickPathExtent,
+ "rendering-intent=%s\n",CommandOptionToMnemonic(MagickIntentOptions,
+ image->rendering_intent));
(void) WriteBlobString(image,buffer);
}
if (image->gamma != 0.0)
bzip_info.bzalloc=AcquireBZIPMemory;
bzip_info.bzfree=RelinquishBZIPMemory;
code=BZ2_bzCompressInit(&bzip_info,(int) (image->quality ==
- UndefinedCompressionQuality ? 7 : MagickMin(image->quality/10,
- 9)),(int) image_info->verbose,0);
+ UndefinedCompressionQuality ? 7 : MagickMin(image->quality/10,9)),
+ (int) image_info->verbose,0);
if (code != BZ_OK)
status=MagickFalse;
break;
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,GetImageListLength(
+ image));
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
}
if (image->intensity != UndefinedPixelIntensityMethod)
{
- (void) FormatLocaleString(buffer,MagickPathExtent,"pixel-intensity=%s\n",
- CommandOptionToMnemonic(MagickPixelIntensityOptions,
- image->intensity));
+ (void) FormatLocaleString(buffer,MagickPathExtent,
+ "pixel-intensity=%s\n",CommandOptionToMnemonic(
+ MagickPixelIntensityOptions,image->intensity));
(void) WriteBlobString(image,buffer);
}
if (image->endian != UndefinedEndian)
}
if (image->iterations != 0)
{
- (void) FormatLocaleString(buffer,MagickPathExtent,"iterations=%.20g\n",
- (double) image->iterations);
+ (void) FormatLocaleString(buffer,MagickPathExtent,
+ "iterations=%.20g\n",(double) image->iterations);
(void) WriteBlobString(image,buffer);
}
if (image->delay != 0)