Author: rmottola
Date: Thu Apr 7 01:05:23 2016
New Revision: 39640
URL: http://svn.gna.org/viewcvs/gnustep?rev=39640&view=rev
Log:
minor NSInteger cleanup and log error
casesGWorkspace/Thumbnailer/ImageThumbnailer/ImageThumbnailer.m
Modified:
apps/gworkspace/trunk/GWorkspace/Thumbnailer/ImageThumbnailer/ImageThumbnailer.m
Modified:
apps/gworkspace/trunk/GWorkspace/Thumbnailer/ImageThumbnailer/ImageThumbnailer.m
URL:
http://svn.gna.org/viewcvs/gnustep/apps/gworkspace/trunk/GWorkspace/Thumbnailer/ImageThumbnailer/ImageThumbnailer.m?rev=39640&r1=39639&r2=39640&view=diff
==============================================================================
---
apps/gworkspace/trunk/GWorkspace/Thumbnailer/ImageThumbnailer/ImageThumbnailer.m
(original)
+++
apps/gworkspace/trunk/GWorkspace/Thumbnailer/ImageThumbnailer/ImageThumbnailer.m
Thu Apr 7 01:05:23 2016
@@ -48,13 +48,14 @@
CREATE_AUTORELEASE_POOL(arp);
NSImage *image = [[NSImage alloc] initWithContentsOfFile: path];
- if (image && [image isValid]) {
- NSData *tiffData = [image TIFFRepresentation];
- NSBitmapImageRep *srcRep = [NSBitmapImageRep imageRepWithData: tiffData];
- int srcSpp = [srcRep samplesPerPixel];
- int bitsPerPixel = [srcRep bitsPerPixel];
-
- if (((srcSpp == 3) && (bitsPerPixel == 24))
+ if (image && [image isValid])
+ {
+ NSData *tiffData = [image TIFFRepresentation];
+ NSBitmapImageRep *srcRep = [NSBitmapImageRep imageRepWithData: tiffData];
+ NSInteger srcSpp = [srcRep samplesPerPixel];
+ NSInteger bitsPerPixel = [srcRep bitsPerPixel];
+
+ if (((srcSpp == 3) && (bitsPerPixel == 24))
|| ((srcSpp == 4) && (bitsPerPixel == 32))
|| ((srcSpp == 1) && (bitsPerPixel == 8))
|| ((srcSpp == 2) && (bitsPerPixel == 16))) {
@@ -85,7 +86,7 @@
unsigned char *srcData;
unsigned char *destData;
unsigned x, y;
- unsigned i;
+ NSInteger i;
NSData *tiffData;
dstsizeW = (NSInteger)floor([srcRep pixelsWide] / fact + 0.5);
@@ -127,8 +128,16 @@
return AUTORELEASE (tiffData);
}
+ }
+ else
+ {
+ NSLog(@"Unsupported image depth/format: %@", path);
+ }
}
- }
+ else
+ {
+ NSLog(@"Invalid image: %@", path);
+ }
RELEASE (image);
RELEASE (arp);
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs