mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 05:32:11 +00:00
* Source/NSBitmapImageRep.m
(TIFFRepresentationOfImageRepsInArray:): Only return a non-null NSData object. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@39090 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
106014c439
commit
7272bf329b
2 changed files with 34 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2015-10-24 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSBitmapImageRep.m
|
||||
(TIFFRepresentationOfImageRepsInArray:): Only return a non-null
|
||||
NSData object.
|
||||
|
||||
2015-10-22 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSWindowController.m (-_windowWillClose:): Don't unset
|
||||
|
|
|
@ -1380,6 +1380,7 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
|
|||
char *bytes = 0;
|
||||
long length = 0;
|
||||
int num = 0;
|
||||
NSData *data;
|
||||
|
||||
image = NSTiffOpenDataWrite(&bytes, &length);
|
||||
if (image == 0)
|
||||
|
@ -1412,7 +1413,17 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
|
|||
}
|
||||
|
||||
NSTiffClose(image);
|
||||
return [NSData dataWithBytesNoCopy: bytes length: length];
|
||||
data = [NSData dataWithBytesNoCopy: bytes length: length];
|
||||
if (num > 0)
|
||||
{
|
||||
return data;
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: Not sure wether this is the correct behaviour, at least it was
|
||||
// the old one of this method.
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
/** Produces an NSData object containing a TIFF representation of all
|
||||
|
@ -1429,6 +1440,8 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
|
|||
TIFF *image;
|
||||
char *bytes = 0;
|
||||
long length = 0;
|
||||
int num = 0;
|
||||
NSData *data;
|
||||
|
||||
image = NSTiffOpenDataWrite(&bytes, &length);
|
||||
if (image == 0)
|
||||
|
@ -1444,6 +1457,9 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
|
|||
[(NSBitmapImageRep*)rep _fillTIFFInfo: &info
|
||||
usingCompression: compression
|
||||
factor: factor];
|
||||
info.imageNumber = num++;
|
||||
info.numImages = [anArray count];
|
||||
info.subfileType = FILETYPE_PAGE;
|
||||
if (NSTiffWrite(image, &info, [(NSBitmapImageRep*)rep bitmapData]) != 0)
|
||||
{
|
||||
[NSException raise: NSTIFFException format: @"Writing data"];
|
||||
|
@ -1452,7 +1468,17 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
|
|||
}
|
||||
|
||||
NSTiffClose(image);
|
||||
return [NSData dataWithBytesNoCopy: bytes length: length];
|
||||
data = [NSData dataWithBytesNoCopy: bytes length: length];
|
||||
if (num > 0)
|
||||
{
|
||||
return data;
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: Not sure wether this is the correct behaviour, at least it was
|
||||
// the old one of this method.
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
/** Returns an NSData object containing a TIFF representation of the
|
||||
|
|
Loading…
Reference in a new issue