mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 02:04:20 +00:00
Fix image encoding
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10827 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
db36c5906c
commit
94398b3eda
3 changed files with 11 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
2001-08-31 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Source/NSBitmapImageRep.m (-encodeWithCoder:): Encode data correctly.
|
||||
* Source/tiff.m (NSTiffWrite): Fix type, use ==.
|
||||
|
||||
Fri Aug 31 12:06:24 2001 Nicola Pero <nicola@brainstorm.co.uk>
|
||||
|
||||
* Source/GSSimpleLayoutManager.m ([_GNULineLayoutInfo
|
||||
|
|
|
@ -621,7 +621,7 @@
|
|||
NSData *data = [self TIFFRepresentation];
|
||||
|
||||
[super encodeWithCoder: aCoder];
|
||||
[data encodeWithCoder: aCoder];
|
||||
[aCoder encodeObject: data];
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||
|
|
|
@ -204,7 +204,7 @@ NSTiffOpenDataRead(const char* data, long size)
|
|||
handle->outposition = 0;
|
||||
handle->size = size;
|
||||
handle->mode = "r";
|
||||
return TIFFClientOpen("TiffData", "r",
|
||||
return TIFFClientOpen("GSTiffReadData", "r",
|
||||
(thandle_t)handle,
|
||||
TiffHandleRead, TiffHandleWrite,
|
||||
TiffHandleSeek, TiffHandleClose,
|
||||
|
@ -223,7 +223,7 @@ NSTiffOpenDataWrite(char **data, long *size)
|
|||
handle->outposition = size;
|
||||
handle->size = *size;
|
||||
handle->mode = "w";
|
||||
return TIFFClientOpen("TiffData", "w",
|
||||
return TIFFClientOpen("GSTiffWriteData", "w",
|
||||
(thandle_t)handle,
|
||||
TiffHandleRead, TiffHandleWrite,
|
||||
TiffHandleSeek, TiffHandleClose,
|
||||
|
@ -275,7 +275,8 @@ NSTiffGetInfo(int imageNumber, TIFF* image)
|
|||
TIFFGetField(image, TIFFTAG_IMAGEWIDTH, &info->width);
|
||||
TIFFGetField(image, TIFFTAG_IMAGELENGTH, &info->height);
|
||||
TIFFGetField(image, TIFFTAG_COMPRESSION, &info->compression);
|
||||
TIFFGetField(image, TIFFTAG_JPEGQUALITY, &info->quality);
|
||||
if (info->compression == COMPRESSION_JPEG)
|
||||
TIFFGetField(image, TIFFTAG_JPEGQUALITY, &info->quality);
|
||||
TIFFGetField(image, TIFFTAG_SUBFILETYPE, &info->subfileType);
|
||||
TIFFGetField(image, TIFFTAG_EXTRASAMPLES, &info->extraSamples, &sample_info);
|
||||
info->extraSamples = (info->extraSamples == 1
|
||||
|
@ -451,7 +452,7 @@ NSTiffWrite(TIFF* image, NSTiffInfo* info, char* data)
|
|||
TIFFSetField(image, TIFFTAG_IMAGEWIDTH, info->width);
|
||||
TIFFSetField(image, TIFFTAG_IMAGELENGTH, info->height);
|
||||
TIFFSetField(image, TIFFTAG_COMPRESSION, info->compression);
|
||||
if (info->compression = COMPRESSION_JPEG)
|
||||
if (info->compression == COMPRESSION_JPEG)
|
||||
TIFFSetField(image, TIFFTAG_JPEGQUALITY, info->quality);
|
||||
TIFFSetField(image, TIFFTAG_SUBFILETYPE, info->subfileType);
|
||||
TIFFSetField(image, TIFFTAG_BITSPERSAMPLE, info->bitsPerSample);
|
||||
|
|
Loading…
Reference in a new issue