Re: TIFF Error?
Re: TIFF Error?
- Subject: Re: TIFF Error?
- From: "Louis C. Sacha" <email@hidden>
- Date: Tue, 22 Jun 2004 14:17:27 -0700
Hello...
Have you tried reading in the TIFF and setting the button image
manually in your awakeFromNib method so that you can log what is
going on?
/* typed in mail, etc */
- (void)awakeFromNib
{
/* ... */
NSString *imagePath = [gPluginBundle
pathForResource:@"yourButtonImage" ofType:@"tiff"];
if (!imagePath) {NSLog(@"button image not found");}
else
{
NSImage *buttonImage = [[[NSImage alloc]
initWithContentsOfFile:imagePath] autorelease];
if (!buttonImage) {NSLog(@"button image could not be
created");}
else
{
[yourButton setImage:buttonImage]; /*
yourButton is the outlet to the button */
}
}
}
Hope that helps,
Louis
I have an iMovie plugin that is written in Cocoa. In it, I have a
.nib file containing a window with some UI elements. I can
successfully display the window and allow the user to interact with
it. However, one of the buttons in the UI uses a TIFF image, and
when it comes time to read the tiff image, the console displays the
error:
TIFF Error: Cannot read TIFF.
I'm a little confused by this. Does this mean that it cannot locate
the TIFF or that it has located it, but for some reason cannot parse
the data in it?
The TIFF is a very standard format - 32 bit per pixel ARGB, created
in Photoshop. Running it through tiffutil shows nothing out of the
ordinary. I can successfully display the TIFF in Preview with no
problems. However, I notice that when I attempt to click on the
"Images" tab in Interface Builder, the UI ends up in an inconsistent
state, and it won't show me the images. The tabs across the top show
the "Classes" tab as selected, and the "Images" tab as darker gray
than the others, and the area under the tab shows nothing. The info
panel shows the name of the image but does not show either the image
or the width and height of the image. I've tried TIFFs without alpha
channels, too, and I get the same results.
I could understand that the plugin might not be able to find the
image when running since its in the plugin's bundle and not the main
app bundle. Is there a way to tell it to look in the plugin bundle
for resources, or does that happen automatically?
I'm load the nib by first getting the plugin's bundle at a time when
its known to be loaded. Then later I load the nib by doing this:
[gPluginBundle loadNibFile:@"nibfilename"
externalNameTable:nameTable withZone:nil];
The nib file is definitely getting loaded, as the window and all UI
elements show up. Is there anything else I should be doing?
Thanks,
Darrin
--
Darrin Cardani - email@hidden
President, Buena Software, Inc.
<http://www.buena.com/>
Video, Image and Audio Processing Development
_______________________________________________
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.
_______________________________________________
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: | |
| >TIFF Error? (From: Darrin Cardani <email@hidden>) |