1. So I tested V1.0.0.1 of CornerFix on Windows 7, and guess what - it broke. Specifically, while images were converted, corrected, etc, they weren't displayed.

    A little digging around showed that Microsoft, in their wisdom, have changed the behavior of the .Net 2 Picturebox control. Previously, under both XP and Vista, if the Picturebox control came across a file that it couldn't decode, but could extract a thumbnail from, it would display the thumbnail. Entirely logical and useful behavior, and what CornerFix depended on. That has changed in Windows 7 - all you get now is that Picturebox throws an exception, and displays a little cross icon.

    I posted a query on the .Net part of the MSDN forum, and of course got the helpful suggestion (from a Microsoft employee) that as this was "a Windows 7 problem", I should post on the general Windows 7 forum. Very useful. Let's do anything we can to avoid actually solving the problem.

    So given that Microsoft weren't going to offer any work-around, I got to thinking about how to solve this one myself. My first thought was to generate a JPEG from the thumbnail image data in the DNG file. A bit of work showed that while that was possible, it was going to be pretty messy. However, a better thought occurred to me. A DNG file is actually just a TIFF with additional tags, and a sub-IFD structure. In fact, what a DNG consists of is a single IFD which contains the thumbnail as well as the main image in raw form as a sub-IFD. Now the thumbnail is actually a perfectly valid TIFF image, it's just tagged via the kcNewSubFileType tag as "1" to show its a thumnail. In fact, the TIFF/EP spec requires that "In TIFF/EP files, the 0th IFD should be an image that can be read by a baseline TIFF 6.0 reader." So to get a valid TIFF file, which Picturebox can display, all that's required is to extract the thumbnail in the 0th IFD, and relabel it as the main image.

    So, that's what I did. Now CornerFix uses Adobe's DNG SDK, so in theory I could have used that, but a quick look showed that the SDK isn't designed to extract thumbnails. In fact, it pretty much ignores them. So I decided to code a completely separate thumbnail extractor in C++, on the basis that it would be useful as a standalone product.

    Because TIFF is a complex format, it turned out to be a more complex piece of code than I'd hoped, but I got it done, and its now part of CornerFix V1.1.0.0, which shipped a few days ago.

    For those interested in using it, its just a single C++ file - tiffThumb.cpp - and its associated tiffThumb.h file, with no dependencies on anything else. The API is simple - it takes a file name, and return a memory buffer with the TIFF thumbnail file in it. I've tested it on both Windows and OS X. The documentation is in the tiffThumb.h file.

    The file can be downloaded as part of the CornerFix source code, here.

    0

    Add a comment

  2. So I've been lazy about blogging, and productive about writing software. Since I last blogged about software releases, I've released not one, but two new open source applications, keychainDD and pcdtojpeg.



    keychainDD
    keychainDD is an OS keychain manager that delivers very secure drag&drop capability to the OS X Keychain management system. Why I wrote it was that OS X has a very robust password management system in the Keychain system, but in my view, there were two deficiencies:
    1. No drag&drop - you can have Safari (or whatever else) autofill your passwords on web pages, but I've never been very comfortable with that - I'm always suspicious that even a badly spoofed website may be good enough to get any autofill program to cough up my passwords. And copying via cut&paste is vulnerable to keyloggers (yes, there are keyloggers for OS X). So keychainDD only allows you to explicitly drag&drop passwords. Not only is drag&drop a lot more secure on OS X than cut&paste, but the way that keychainDD implements drag&drop is in a very secure way, btw.
    2. No support for "Memorable Information". A lot of financial sites that I use now require what is effectively a second password, usually one that you have to enter a few selected characters via an on-screen menu or keyboard. This is a protection against keyloggers, and in my view a very good thing. But you have to remeber that information, and be able to count characters to get the 5th character, the 3rd, etc. keychainDD supports memorable information, and has a neat character-by-character tray type display that means you don't have to write down your memorable information to count characters.
    So, anyway, that's keyChainDD. It's website is here, and you can download it here.

    pcdtojpeg
    pcdtojpeg converts Kodak Photo CD (PCD) files into JPEG files. I wrote it because basically every other solution out there for doing any kind of PCD conversion just sucks. Either they blow highlights, get colors wrong, only convert at very low resolution, or just don't work all. I won't mention any names here, but pretty much every other solution out there that I tried doesn't work. And don't just believe me, take a look at Ted Felix's PCD site.

    pcdtojpeg gets the color right, won't blow highlights, and runs under any of OS X, Windows or linux.

    pcdtojpeg also isn't just a monolithic application, it's PCD decoder comes in the form of a proper C++ library that other programs can use.

    Acknowledgments: Although pcdtojpeg shares no code with Hadmut Danisch's hpcdtoppm, and can decode image information that hpctoppm can't, pcdtojpeg would not have been possible without the work that Hadmut did in reverse engineering the format in the early 1990’s in order to write hpcdtoppm. For those interested, hpcdtoppm converts PCD images into ppm format images.

    pcdtojpeg's website is here, and you can download it here.
    2

    View comments

Popular Posts
Blog Archive
About Me
About Me
My Photo
Author of AccuRaw, PhotoRaw, CornerFix, pcdMagic, pcdtojpeg, dcpTool, WinDat Opener and occasional photographer....
Loading