[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
TiffRep from NSImage problem
From: |
Iikka Virkkunen |
Subject: |
TiffRep from NSImage problem |
Date: |
Thu, 28 Aug 2003 19:56:03 +0300 |
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.
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?
I'm building the tool with a primitive tool-makefile with -lgnustep-gui
added to TOOL_LIBS.
Iikka
- TiffRep from NSImage problem,
Iikka Virkkunen <=