• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSBitmapImageRep problem (I think)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBitmapImageRep problem (I think)


  • Subject: Re: NSBitmapImageRep problem (I think)
  • From: Ondra Cada <email@hidden>
  • Date: Fri, 19 Apr 2002 14:29:08 +0200

On Friday, April 19, 2002, at 02:14 , Brian Williams wrote:

Is it required that a NSBitmapImageRep be added to an NSImage instance?

It is not (or at the very least, it was not in MOSXS1). This simple tool worked for me quite well:

#import <AppKit/AppKit.h>

int main (int argc, const char *argv[])
{
if (argc<2) {
printf("%s <file with TIFF data> G|P|J\n\nGif/Png/Jpeg data will overwrite the orig.file\n",argv[0]);
} else {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString *f=[NSString stringWithCString:argv[1]];
NSData *tiffData=[NSData dataWithContentsOfFile:f];
NSBitmapImageFileType t=argv[2][0]=='G'?NSGIFFileType:argv[2][0]=='P'?NSPNGFileType:NSJPEGFileType;
if (!tiffData || ![[[NSBitmapImageRep imageRepWithData:tiffData] representationUsingType:t properties:nil] writeToFile:f atomically:NO])
exit(1);
exit(0); // _E_nsure the process exit status is 0
}
return 0; // ...and make main fit the ANSI spec.
}
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Re: NSBitmapImageRep problem (I think) (From: Brian Williams <email@hidden>)

  • Prev by Date: Re: NSBitmapImageRep problem (I think)
  • Next by Date: Re: Checking if volume is busy?
  • Previous by thread: Re: NSBitmapImageRep problem (I think)
  • Next by thread: Re: NSBitmapImageRep problem (I think)
  • Index(es):
    • Date
    • Thread