[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TiffRep from NSImage problem
From: |
Adam Fedor |
Subject: |
Re: TiffRep from NSImage problem |
Date: |
Fri, 29 Aug 2003 16:07:26 -0600 |
On Thursday, August 28, 2003, at 10:56 AM, Iikka Virkkunen wrote:
Dear list,
I wrote a small command line tool in Cocoa, which prepares my photos
for web. I tried to port it to GNUStep, but run into trouble. The
stripped down logic goes like this:
int main (int argc, const char * argv[]) {
for (...) // for all input images
{
NSImage *retimg = ... //Create an empty NSImage
NSImage *dimg = ... //Create an NSImage from the input file
[retimg lockFocus]; // lock focus to retimg and draw the final image
to it
// draw background, scaled dimg and
// nice corners with NSBezierPath
[retimg unlockFocus];
[[retimg TIFFRepresentation] writeToFile:outfilename atomically:NO];
{
}
... but [retimb TIFFRepresentation] fails silently and returns nil.
It currently doesn't handle converting different types of images (like
NSCachedImageRep) to NSBitmapImageRep. Unfortunately, it returns nil
instead of telling you that.
So, I tried a workaround:
[retimg lockFocus];
NSBitmapImageRep *tmpbmp = [[NSBitmapImageRep alloc]
initWithFocusedViewRect: NSMakeRect(0,0,w,h)];
[retimg unlockFocus];
[[tmpbmp TIFFRepresentation] writeToFile:outfilename
atomically:NO];
... and got a critical error: initWithFocusedViewRect is not
implemented.
So, what could be the reason my call to TIFFRepresentation fails?
How should I do this, then?
There doesn't appear to be a work around for this currently. Sorry.
File a bug report and hopefully someone will fix it...