From: Udi F. <udi...@gm...> - 2005-06-16 14:33:31
|
Hi, I'm the author of UFRaw (http://ufraw.sourceforge.net/), which is a tool for converting raw images from digital camera, based on DCRaw. I got a patch for reading the EXIF data from some raw format. It uses libtiff and libexif and it is base on the fact that some raw file are actually TIFF files (Nikon NEF, Canon CR2, Pentax PEF). I merged this code into the development version of UFRaw, which can be checked-out from the CVS. I have the following issues with this patch: 1. The code looks like a hack to make libexif read the TIFF file. Isn't there a more natural way for libexif to read TIFF files? 2. I can read the MakerNotes, but if I try "exif --show-mnote" on the generated JPG file, it seems that it contains no information. The output is: MakerNote contains 43 values: Firmware Version: Firmware Version ISO Setting: ISO Setting Quality: Quality Whitebalance: Whitebalance ... The problem is in the generated JPG and not in the original raw file, since using 'ufraw-exif' (see later on) I get these fields correctly. 3. Other raw format are not TIFF files, but have somewhat similar format. Could there be a "simple" way to generalize this code for these files? Could you look at the code, and tell me what you think of it? To simplify your lives I created also a small stand-alone version. After the cvs checkout you need to: ./autogen.sh ./configure --enable-extras make This will create an extra executable 'ufraw-exif' which is based only on ufraw_exif.c, so you don't need to look at any of the other ufraw source files. It's usage is very simple: usage: ufraw-exif input-file.raw [output-file.jpg] ufraw-exif dumps the EXIF data from the RAW file to stdout. If a JPEG file is specified, the EXIF data is copied to it. This overwrites the original JPEG, so make sure you have a backup for it. I can also send people some sample RAW files on demand. Udi |
From: Lutz <lu...@us...> - 2005-06-16 16:53:17
|
On Thu, 2005-06-16 at 16:33 +0200, Udi Fuchs wrote: > I got a patch for reading the EXIF data from some raw format. It uses > libtiff and libexif and it is base on the fact that some raw file are > actually TIFF files (Nikon NEF, Canon CR2, Pentax PEF). Could you post the patch on this list? > 2. I can read the MakerNotes, but if I try "exif --show-mnote" on the > generated JPG file, it seems that it contains no information. Could you make available some test images? Regards --=20 Lutz M=FCller <lu...@us...> |
From: Udi F. <udi...@gm...> - 2005-06-17 10:02:56
Attachments:
ufraw_exif.c
|
> Could you post the patch on this list? The patch is already Incorporated in UFRaw's CVS. I'm attaching ufraw_exif.c, so you won't need to check out ufraw from the cvs. You can compile it with the command: cc -D_STAND_ALONE_ -DHAVE_LIBEXIF -o ufraw-exif ufraw_exif.c -lexif -ljpeg -ltiff -lz > Could you make available some test images? You can download (notice that it is 6MB big): http://ufraw.sourceforge.net/dsc_0113.nef Then 'ufraw-exif dsc_0113.nef' will show you the exif data and mnotes that libexif recognized in this file. You can also 'ufraw-exif dsc_0113.nef a.jpg', where a.jpg is any jpg file you have. Then you can see with 'exif a.jpg' that the basic exif-data was saved correctly, but not the maker-notes. Udi |
From: Lutz <lu...@us...> - 2005-06-28 06:11:35
|
On Fri, 2005-06-17 at 12:02 +0200, Udi Fuchs wrote: > The patch is already Incorporated in UFRaw's CVS. I'm attaching > ufraw_exif.c, so you won't need to check out ufraw from the cvs. I'd like to move that code into libexif. However, I'd like to avoid a dependency on libtiff. Do you know the TIFF file format? How do I navigate through the start of the file 4D 4D 00 2A 00 00 00 08 00 18 00 FE 00 04 00 00 00 01 00 00 00 01 00 ... in order to find the EXIF information? Regards --=20 Lutz M=FCller <lu...@us...> |
From: Hubert F. <hfi...@te...> - 2005-06-28 06:27:16
|
Lutz M=FCller wrote: > On Fri, 2005-06-17 at 12:02 +0200, Udi Fuchs wrote: >=20 >>The patch is already Incorporated in UFRaw's CVS. I'm attaching >>ufraw_exif.c, so you won't need to check out ufraw from the cvs. >=20 >=20 > I'd like to move that code into libexif. However, I'd like to avoid a > dependency on libtiff. Do you know the TIFF file format? How do I > navigate through the start of the file >=20 > 4D 4D 00 2A 00 00 00 08 00 18 00 FE 00 04 00 00 00 01 00 00 00 01 00 ..= . >=20 What is the issue about depending on LibTIFF ? Since you want to parse=20 TIFF, it is probably you best solution, as the other program is likely=20 to depend on it too. I think that LibTIFF is a decent dependency. Hub |
From: Lutz <lu...@us...> - 2005-06-28 06:44:46
|
On Tue, 2005-06-28 at 02:23 -0400, Hubert Figuiere wrote: > What is the issue about depending on LibTIFF ? It could be that we just don't need it. We don't need jpeglib in order to parse JPEGs. Navigation to the start of the EXIF data is trivial. This could be the same for TIFF files. I don't know, though. --=20 Lutz M=FCller <lu...@us...> |
From: Jan P. <pa...@pi...> - 2005-06-28 08:01:12
|
> What is the issue about depending on LibTIFF ? Since you want to parse > TIFF, it is probably you best solution, as the other program is likely > to depend on it too. > > I think that LibTIFF is a decent dependency. No, no. Please don't introduce hard-coded dependency on libTIFF. There are tools using libEXIF and not libTIFF which is quite huge. -- Jan |
From: Hubert F. <hfi...@te...> - 2005-06-30 02:50:03
|
Lutz M=FCller wrote: > On Tue, 2005-06-28 at 02:23 -0400, Hubert Figuiere wrote: >=20 >>What is the issue about depending on LibTIFF ? >=20 >=20 > It could be that we just don't need it. We don't need jpeglib in order > to parse JPEGs. Navigation to the start of the EXIF data is trivial. > This could be the same for TIFF files. I don't know, though. All you need is to fetch the tag from the TIFF. You can still do the=20 minimum... All you need is to walk thru the TIFF structures. Like reinventing the wheel ? Hub |
From: Lutz <lu...@us...> - 2005-06-30 20:43:30
|
On Wed, 2005-06-29 at 22:46 -0400, Hubert Figuiere wrote: > Like reinventing the wheel ? Again, I don't know how complex the TIFF structure is. JPEG is trivial. Regards --=20 Lutz M=FCller <lu...@us...> |
From: Udi F. <udi...@gm...> - 2005-06-30 22:20:56
|
I'm also no expert in the TIFF structure, but looking at dcraw.c and specifically at the function parse_tiff() it looks pretty simple. I think that it is the sample as JPEG after you remove the first 12 bytes from the JPEG header. Udi On 6/30/05, Lutz M=FCller <lu...@us...> wrote: > On Wed, 2005-06-29 at 22:46 -0400, Hubert Figuiere wrote: > > Like reinventing the wheel ? >=20 > Again, I don't know how complex the TIFF structure is. JPEG is trivial. >=20 > Regards > -- > Lutz M=FCller <lu...@us...> >=20 >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick > _______________________________________________ > Libexif-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libexif-devel > |
From: Daniel M. G. <dmg...@uv...> - 2005-06-30 22:44:34
|
Udi Fuchs twisted the bytes to say: Udi> I'm also no expert in the TIFF structure, but looking at dcraw.c and Udi> specifically at the function parse_tiff() it looks pretty simple. I Udi> think that it is the sample as JPEG after you remove the first 12 Udi> bytes from the JPEG header. As trivial/difficult as JPEG. At least the canon version. It embeds a EXIF record inside the tiff, two several jpegs and the raw data. You can check the code I wrote to scan this files in gqview (src/format_canon.c). It is fairly simple and straightforward (100-200 lines of code). gqview is in C, though. It is nicely documented by Adobe (TIFF V 6.0). Udi> Udi Udi> On 6/30/05, Lutz M=FCller <lu...@us...> wrote: >> On Wed, 2005-06-29 at 22:46 -0400, Hubert Figuiere wrote: >> > Like reinventing the wheel ? >> =20 >> Again, I don't know how complex the TIFF structure is. JPEG is trivial. >> =20 >> Regards >> -- >> Lutz M=FCller <lu...@us...> >> =20 >> =20 >> =20 >> ------------------------------------------------------- >> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >> from IBM. Find simple to follow Roadmaps, straightforward articles, >> informative Webcasts and more! Get everything you need to get up to >> speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick >> _______________________________________________ >> Libexif-devel mailing list >> Lib...@li... >> https://lists.sourceforge.net/lists/listinfo/libexif-devel >> Udi> ------------------------------------------------------- Udi> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies Udi> from IBM. Find simple to follow Roadmaps, straightforward articles, Udi> informative Webcasts and more! Get everything you need to get up to Udi> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click Udi> _______________________________________________ Udi> Libexif-devel mailing list Udi> Lib...@li... Udi> https://lists.sourceforge.net/lists/listinfo/libexif-devel -- Daniel M. German "Do not confuse luck with skill. " The Replacement Killers" http://turingmachine.org/ http://silvernegative.com/ dmg (at) uvic (dot) ca replace (at) with @ and (dot) with . |
From: Jan P. <pa...@pi...> - 2005-07-01 05:11:21
|
Hi guys, TIFF structure is simple. In fact, libEXIF already contains TIFF parsers. EXIF is built on top of TIFF. The TIFF consists of an 8-byte TIFF header (already parsed in exif_data_load_data and Cannon mnote), several IFDs, and image data. I am volunteering to extend libEXIF to parse EXIF embedded in TIFF. However, because leaving for holiday, I can do it after July the 10th. == Jan > Udi Fuchs twisted the bytes to say: > > Udi> I'm also no expert in the TIFF structure, but looking at dcraw.c > and Udi> specifically at the function parse_tiff() it looks pretty > simple. I Udi> think that it is the sample as JPEG after you remove the > first 12 Udi> bytes from the JPEG header. > > As trivial/difficult as JPEG. At least the canon version. It embeds a > EXIF record inside the tiff, two several jpegs and the raw data. You can > check the code I wrote to scan this files in gqview > (src/format_canon.c). It is fairly simple and straightforward (100-200 > lines of code). gqview is in C, though. It is nicely documented by Adobe > (TIFF V 6.0). > > > > Udi> Udi > > Udi> On 6/30/05, Lutz M=FCller <lu...@us...> wrote: > >> On Wed, 2005-06-29 at 22:46 -0400, Hubert Figuiere wrote: > >> > Like reinventing the wheel ? > >> =20 > >> Again, I don't know how complex the TIFF structure is. JPEG is > trivial. =20 > >> Regards > >> -- |