Re: IKImageBrowserView is bonkers
Re: IKImageBrowserView is bonkers
- Subject: Re: IKImageBrowserView is bonkers
- From: "Ken Ferry" <email@hidden>
- Date: Fri, 6 Jun 2008 20:13:07 -0700
On Fri, Jun 6, 2008 at 4:16 PM, Adam R. Maxwell <email@hidden> wrote:
>
> On Jun 6, 2008, at 3:57 PM, j o a r wrote:
>
>>
>> On Jun 6, 2008, at 3:50 PM, Randall Meadows wrote:
>>
>>> The images are captured from a digital camera, which is oriented in a
>>> portrait fashion. Once downloaded from the camera, the images are rotated
>>> (using jpegtran) to a "normal" orientation, the EXIF is edited to match
>>> (using exiftool, since jpegtran leaves the flag alone when it rotates it),
>>> and finally an icon is added to the file using this code:
>>>
>>> NSImage *preview = [[NSImage alloc] initWithContentsOfFile:filePath]];
>>> [[NSWorkspace sharedWorkspace] setIcon:preview forFile:filePath
>>> options:0];
>>>
>>> So the image is created from the rotated, EXIF-fixed image file. The
>>> image file displays correctly in Preview, Safari, QuickLook, and its Finder
>>> preview icon is correct also.
>>>
>>> Why come then does the IKImageBrowserView always initially show the image
>>> rotated 90° CW, and then a little while later refresh it to be correct?
>>> Sorry, not even INITIALLY, its whenever the view updates from the data
>>> source. The data source simply returns the full path to the image in the
>>> filesystem to display when requested. I've already determined that the
>>> image file itself is correct in all ways.
>>>
>>> You can see a short (~30 second) QT movie of this strange behavior in
>>> action at <http://idisk.mac.com/callipygiani/Public/RotationWTF.mov>. The
>>> movie shows several images being captured and added to the view, a couple
>>> deleted from the view, and then another captured and added.
>>>
>>> Any tips or suggestions as to what is going on would be GREATLY
>>> appreciated. I really don't want to have to write my own image browser
>>> view...
>>
>>
>> The images probably have an embedded thumbnail / preview that is not
>> updated when you rotate the main image using "jpegtran". My bet is that the
>> image browser for performance reasons by default use an existing embedded
>> thumbnail / preview to improve perceived performance.
>
> If that's the case, maybe you need to implement -imageVersion from the
> IKImageBrowserItem protocol and bump the version number after you rotate it?
> I haven't tried that, since I wrote my own image browser view ;).
Joar's right on - ImageKit does use the thumbnail if it's there.
It isn't the image browser's cache that's wrong, it's the original
file. It has an embedded thumbnail that is in a different orientation
than the main image data.
-Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden