#define ICC_PROFILE "ICC_PROFILE"
#define IPTC_MARKER (JPEG_APP0+13)
#define XML_MARKER (JPEG_APP0+1)
-#define MaxBufferExtent 16384
#define MaxJPEGScans 1024
\f
/*
source=(SourceManager *) cinfo->src;
source->manager.bytes_in_buffer=(size_t) ReadBlob(source->image,
- MaxBufferExtent,source->buffer);
+ MagickMinBufferExtent,source->buffer);
if (source->manager.bytes_in_buffer == 0)
{
if (source->start_of_blob != FALSE)
((j_common_ptr) cinfo,JPOOL_IMAGE,sizeof(SourceManager));
source=(SourceManager *) cinfo->src;
source->buffer=(JOCTET *) (*cinfo->mem->alloc_small)
- ((j_common_ptr) cinfo,JPOOL_IMAGE,MaxBufferExtent*sizeof(JOCTET));
+ ((j_common_ptr) cinfo,JPOOL_IMAGE,MagickMinBufferExtent*sizeof(JOCTET));
source=(SourceManager *) cinfo->src;
source->manager.init_source=InitializeSource;
source->manager.fill_input_buffer=FillInputBuffer;
destination=(DestinationManager *) cinfo->dest;
destination->manager.free_in_buffer=(size_t) WriteBlob(destination->image,
- MaxBufferExtent,destination->buffer);
- if (destination->manager.free_in_buffer != MaxBufferExtent)
+ MagickMinBufferExtent,destination->buffer);
+ if (destination->manager.free_in_buffer != MagickMinBufferExtent)
ERREXIT(cinfo,JERR_FILE_WRITE);
destination->manager.next_output_byte=destination->buffer;
return(TRUE);
destination=(DestinationManager *) cinfo->dest;
destination->buffer=(JOCTET *) (*cinfo->mem->alloc_small)
- ((j_common_ptr) cinfo,JPOOL_IMAGE,MaxBufferExtent*sizeof(JOCTET));
+ ((j_common_ptr) cinfo,JPOOL_IMAGE,MagickMinBufferExtent*sizeof(JOCTET));
destination->manager.next_output_byte=destination->buffer;
- destination->manager.free_in_buffer=MaxBufferExtent;
+ destination->manager.free_in_buffer=MagickMinBufferExtent;
}
static void TerminateDestination(j_compress_ptr cinfo)
*destination;
destination=(DestinationManager *) cinfo->dest;
- if ((MaxBufferExtent-(int) destination->manager.free_in_buffer) > 0)
+ if ((MagickMinBufferExtent-(int) destination->manager.free_in_buffer) > 0)
{
ssize_t
count;
- count=WriteBlob(destination->image,MaxBufferExtent-
+ count=WriteBlob(destination->image,MagickMinBufferExtent-
destination->manager.free_in_buffer,destination->buffer);
if (count != (ssize_t)
- (MaxBufferExtent-destination->manager.free_in_buffer))
+ (MagickMinBufferExtent-destination->manager.free_in_buffer))
ERREXIT(cinfo,JERR_FILE_WRITE);
}
}
(void) remove_utf8(clone_info->filename);
}
- cache_block = AcquireQuantumMemory((size_t)(*Size < 16384) ? *Size: 16384,sizeof(unsigned char *));
+ cache_block = AcquireQuantumMemory((size_t)(*Size < MagickMinBufferExtent) ? *Size: MagickMinBufferExtent,sizeof(unsigned char *));
if(cache_block==NULL) return NULL;
decompress_block = AcquireQuantumMemory((size_t)(4096),sizeof(unsigned char *));
if(decompress_block==NULL)
zip_info.total_out = 0;
while(*Size>0 && !EOFBlob(orig))
{
- magick_size = ReadBlob(orig, (*Size < 16384) ? *Size : 16384, (unsigned char *) cache_block);
+ magick_size = ReadBlob(orig, (*Size < MagickMinBufferExtent) ? *Size : MagickMinBufferExtent, (unsigned char *) cache_block);
if (magick_size == 0)
break;
zip_info.next_in = (Bytef *) cache_block;
#ifdef MAGICKCORE_ZLIB_DELEGATE
-#define CHUNK 16384
-
int
flush,
level;
#ifdef MAGICKCORE_ZLIB_DELEGATE
if (compression == ZipCompression)
{
- compressed_pixels=(unsigned char *) AcquireQuantumMemory(CHUNK,
- sizeof(*compressed_pixels));
+ compressed_pixels=(unsigned char *) AcquireQuantumMemory(
+ MagickMinBufferExtent,sizeof(*compressed_pixels));
if (compressed_pixels == (unsigned char *) NULL)
{
quantum_info=DestroyQuantumInfo(quantum_info);
if (y == (ssize_t) next_image->rows-1)
flush=Z_FINISH;
do {
- stream.avail_out=(uInt) CHUNK;
+ stream.avail_out=(uInt) MagickMinBufferExtent;
stream.next_out=(Bytef *) compressed_pixels;
if (deflate(&stream,flush) == Z_STREAM_ERROR)
break;
- length=(size_t) CHUNK-stream.avail_out;
+ length=(size_t) MagickMinBufferExtent-stream.avail_out;
if (length > 0)
count+=WriteBlob(image,length,compressed_pixels);
} while (stream.avail_out == 0);