Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #13146 > unrolled thread

EXIF tag handling in Java

Started byMartin Gregorie <martin@address-in-sig.invalid>
First post2012-03-24 21:37 +0000
Last post2012-03-27 09:06 -0700
Articles 20 on this page of 24 — 7 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  EXIF tag handling in Java Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-24 21:37 +0000
    Re: EXIF tag handling in Java Marty Blake <blake3334@nowhere.invalid> - 2012-03-24 23:13 -0400
      Re: EXIF tag handling in Java Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-25 13:09 +0000
        Re: EXIF tag handling in Java Jeff Higgins <jeff@invalid.invalid> - 2012-03-25 11:42 -0400
          Re: EXIF tag handling in Java Jeff Higgins <jeff@invalid.invalid> - 2012-03-25 12:22 -0400
            Re: EXIF tag handling in Java Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-25 17:10 +0000
          Re: EXIF tag handling in Java Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-25 16:46 +0000
            Re: EXIF tag handling in Java Jeff Higgins <jeff@invalid.invalid> - 2012-03-25 12:59 -0400
              Re: EXIF tag handling in Java Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-25 17:15 +0000
                Re: EXIF tag handling in Java Jeff Higgins <jeff@invalid.invalid> - 2012-03-25 14:08 -0400
                  Re: EXIF tag handling in Java Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-25 18:34 +0000
    Re: EXIF tag handling in Java Knute Johnson <nospam@knutejohnson.com> - 2012-03-25 10:46 -0700
      Re: EXIF tag handling in Java Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-25 18:13 +0000
    Re: EXIF tag handling in Java "John B. Matthews" <nospam@nospam.invalid> - 2012-03-25 14:45 -0400
      Re: EXIF tag handling in Java Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-25 23:37 +0000
        Re: EXIF tag handling in Java Lew <lewbloch@gmail.com> - 2012-03-26 11:56 -0700
          Re: EXIF tag handling in Java Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-26 19:48 +0000
          Re: EXIF tag handling in Java Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-26 19:52 +0000
            Re: EXIF tag handling in Java Lew <lewbloch@gmail.com> - 2012-03-26 13:29 -0700
              Re: EXIF tag handling in Java Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-26 21:58 +0000
                Re: EXIF tag handling in Java Lew <lewbloch@gmail.com> - 2012-03-26 16:24 -0700
                  Re: EXIF tag handling in Java Gene Wirchenko <genew@ocis.net> - 2012-03-26 18:19 -0700
                    Re: EXIF tag handling in Java Lew <lewbloch@gmail.com> - 2012-03-26 19:03 -0700
                      Re: EXIF tag handling in Java Gene Wirchenko <genew@ocis.net> - 2012-03-27 09:06 -0700

Page 1 of 2  [1] 2  Next page →


#13146 — EXIF tag handling in Java

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-03-24 21:37 +0000
SubjectEXIF tag handling in Java
Message-ID<jkleq5$dhh$1@localhost.localdomain>
Can anybody recommend a good EXIF tag handling Java package? 

I need to use it for reading and writing 'Comment' tags in at least JPG 
files, and preferably for more image types than just JPG. I found out, by 
experimenting with exiftool, that both PNG and GIF files also support the 
'Comment' tag. 

I have found a couple of packages (Thang To's javaexif and Thomas Lane's 
Mediautil package), both dating from 2006 or so and both largely 
uncommented, which doesn't make them exactly easy to use.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [next] | [standalone]


#13157

FromMarty Blake <blake3334@nowhere.invalid>
Date2012-03-24 23:13 -0400
Message-ID<jkm2ha$aa5$2@speranza.aioe.org>
In reply to#13146
On 24/03/2012 5:37 PM, Martin Gregorie wrote:
> Can anybody recommend a good EXIF tag handling Java package?

Install Java ImageIO and the TIFF plugin for ImageIO and you can get at 
(and modify) JPEG EXIF tags using ImageIO. I'm not sure about other 
formats (except TIFF should work).

[toc] | [prev] | [next] | [standalone]


#13163

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-03-25 13:09 +0000
Message-ID<jkn5f5$qn4$1@localhost.localdomain>
In reply to#13157
On Sat, 24 Mar 2012 23:13:46 -0400, Marty Blake wrote:

> On 24/03/2012 5:37 PM, Martin Gregorie wrote:
>> Can anybody recommend a good EXIF tag handling Java package?
> 
> Install Java ImageIO and the TIFF plugin for ImageIO and you can get at
> (and modify) JPEG EXIF tags using ImageIO. I'm not sure about other
> formats (except TIFF should work).
>
Thanks for that. It looks like all this is in the javax.imageio.* 
packages.

I've had a look at the docs for these packages, including the plugins, 
and frankly I'm baffled and/or confused. There are packages that define 
the tags but nothing that I can find that can, for instance, read or 
write tags from something like a BufferedImage. Is there a tutorial or 
other how-to that covers classes that provide accesss to EXIF tags?
 

-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#13165

FromJeff Higgins <jeff@invalid.invalid>
Date2012-03-25 11:42 -0400
Message-ID<jknea0$u54$1@dont-email.me>
In reply to#13163
On 03/25/2012 09:09 AM, Martin Gregorie wrote:
> On Sat, 24 Mar 2012 23:13:46 -0400, Marty Blake wrote:
>
>> On 24/03/2012 5:37 PM, Martin Gregorie wrote:
>>> Can anybody recommend a good EXIF tag handling Java package?
>>
>> Install Java ImageIO and the TIFF plugin for ImageIO and you can get at
>> (and modify) JPEG EXIF tags using ImageIO. I'm not sure about other
>> formats (except TIFF should work).
>>
> Thanks for that. It looks like all this is in the javax.imageio.*
> packages.
>
> I've had a look at the docs for these packages, including the plugins,
> and frankly I'm baffled and/or confused. There are packages that define
> the tags but nothing that I can find that can, for instance, read or
> write tags from something like a BufferedImage. Is there a tutorial or
> other how-to that covers classes that provide accesss to EXIF tags?
>
>
This may help. May not too. Pretty old.
<http://www.barregren.se/blog/how-read-exif-and-iptc-java-image-i-o-api>
A possible bug.
<http://george.i.ph/blogs/george/2007/09/06/read-and-write-jpeg-exif-using-the-javaximageiometadata-package/>
Links to the "standard" and "native" metadata formats.
<http://docs.oracle.com/javase/7/docs/api/javax/imageio/metadata/package-summary.html>
The parser library referenced in the first link above.
<http://code.google.com/p/metadata-extractor/>

[toc] | [prev] | [next] | [standalone]


#13166

FromJeff Higgins <jeff@invalid.invalid>
Date2012-03-25 12:22 -0400
Message-ID<jkngko$cni$1@dont-email.me>
In reply to#13165
On 03/25/2012 11:42 AM, Jeff Higgins wrote:
> On 03/25/2012 09:09 AM, Martin Gregorie wrote:
>> On Sat, 24 Mar 2012 23:13:46 -0400, Marty Blake wrote:
>>
>>> On 24/03/2012 5:37 PM, Martin Gregorie wrote:
>>>> Can anybody recommend a good EXIF tag handling Java package?
>>>
>>> Install Java ImageIO and the TIFF plugin for ImageIO and you can get at
>>> (and modify) JPEG EXIF tags using ImageIO. I'm not sure about other
>>> formats (except TIFF should work).
>>>
>> Thanks for that. It looks like all this is in the javax.imageio.*
>> packages.
>>
>> I've had a look at the docs for these packages, including the plugins,
>> and frankly I'm baffled and/or confused. There are packages that define
>> the tags but nothing that I can find that can, for instance, read or
>> write tags from something like a BufferedImage. Is there a tutorial or
>> other how-to that covers classes that provide accesss to EXIF tags?
>>
>>
> This may help. May not too. Pretty old.
> <http://www.barregren.se/blog/how-read-exif-and-iptc-java-image-i-o-api>

Link to source broken, found a copyhere:
<http://files.codes-sources.com/fichier_fullscreen.aspx?id=35614&f=GestionDimagesNumeriques+[javaFR]\src\com\picturegrid\imageio\metadata\ImageIOMetadataDemo.java>

> A possible bug.
> <http://george.i.ph/blogs/george/2007/09/06/read-and-write-jpeg-exif-using-the-javaximageiometadata-package/>
>
> Links to the "standard" and "native" metadata formats.
> <http://docs.oracle.com/javase/7/docs/api/javax/imageio/metadata/package-summary.html>
>
> The parser library referenced in the first link above.
> <http://code.google.com/p/metadata-extractor/>
>
>

[toc] | [prev] | [next] | [standalone]


#13170

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-03-25 17:10 +0000
Message-ID<jknjio$tfb$3@localhost.localdomain>
In reply to#13166
On Sun, 25 Mar 2012 12:22:23 -0400, Jeff Higgins wrote:

> On 03/25/2012 11:42 AM, Jeff Higgins wrote:
>> On 03/25/2012 09:09 AM, Martin Gregorie wrote:
>>> On Sat, 24 Mar 2012 23:13:46 -0400, Marty Blake wrote:
>>>
>>>> On 24/03/2012 5:37 PM, Martin Gregorie wrote:
>>>>> Can anybody recommend a good EXIF tag handling Java package?
>>>>
>>>> Install Java ImageIO and the TIFF plugin for ImageIO and you can get
>>>> at (and modify) JPEG EXIF tags using ImageIO. I'm not sure about
>>>> other formats (except TIFF should work).
>>>>
>>> Thanks for that. It looks like all this is in the javax.imageio.*
>>> packages.
>>>
>>> I've had a look at the docs for these packages, including the plugins,
>>> and frankly I'm baffled and/or confused. There are packages that
>>> define the tags but nothing that I can find that can, for instance,
>>> read or write tags from something like a BufferedImage. Is there a
>>> tutorial or other how-to that covers classes that provide accesss to
>>> EXIF tags?
>>>
>>>
>> This may help. May not too. Pretty old.
>> <http://www.barregren.se/blog/how-read-exif-and-iptc-java-image-i-o-
api>
> 
> Link to source broken, found a copyhere:
> <http://files.codes-sources.com/fichier_fullscreen.aspx?
id=35614&f=GestionDimagesNumeriques+[javaFR]\src\com\picturegrid\imageio
\metadata\ImageIOMetadataDemo.java>
> 
>> A possible bug.
>> <http://george.i.ph/blogs/george/2007/09/06/read-and-write-jpeg-exif-
using-the-javaximageiometadata-package/>
>>
>> Links to the "standard" and "native" metadata formats.
>> <http://docs.oracle.com/javase/7/docs/api/javax/imageio/metadata/
package-summary.html>
>>
>> The parser library referenced in the first link above.
>> <http://code.google.com/p/metadata-extractor/>
>>
>>

Thanks for the URL correction. 


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#13168

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-03-25 16:46 +0000
Message-ID<jkni4n$tfb$2@localhost.localdomain>
In reply to#13165
On Sun, 25 Mar 2012 11:42:30 -0400, Jeff Higgins wrote:

> On 03/25/2012 09:09 AM, Martin Gregorie wrote:
>> On Sat, 24 Mar 2012 23:13:46 -0400, Marty Blake wrote:
>>
>>> On 24/03/2012 5:37 PM, Martin Gregorie wrote:
>>>> Can anybody recommend a good EXIF tag handling Java package?
>>>
>>> Install Java ImageIO and the TIFF plugin for ImageIO and you can get
>>> at (and modify) JPEG EXIF tags using ImageIO. I'm not sure about other
>>> formats (except TIFF should work).
>>>
>> Thanks for that. It looks like all this is in the javax.imageio.*
>> packages.
>>
>> I've had a look at the docs for these packages, including the plugins,
>> and frankly I'm baffled and/or confused. There are packages that define
>> the tags but nothing that I can find that can, for instance, read or
>> write tags from something like a BufferedImage. Is there a tutorial or
>> other how-to that covers classes that provide accesss to EXIF tags?
>>
>>
> This may help. May not too. Pretty old.
> <http://www.barregren.se/blog/how-read-exif-and-iptc-java-image-i-o-api>
> A possible bug.
> <http://george.i.ph/blogs/george/2007/09/06/read-and-write-jpeg-exif-
using-the-javaximageiometadata-package/>
> Links to the "standard" and "native" metadata formats.
> <http://docs.oracle.com/javase/7/docs/api/javax/imageio/metadata/
package-summary.html>
> The parser library referenced in the first link above.
> <http://code.google.com/p/metadata-extractor/>

Thanks for those links. That Google parser is read-only, but its 
documentation looks useful.

Just now I thought to look at Apache Commons and found the Sanselan 
package, which does a similar job to the javax.imagio.* stuff but as a 
free-standing package and, unlike them, it includes EXIF read/write 
abilities. 

Its interesting that all this stuff is about the same age: Java 1.4 or 5 
and none of it seems to have been updated since. Maybe, since nothing has 
changed in the JPEG/TIFF worlds since then it hasn't needed any updates, 
though as its all decidedly light on documentation, some changes there 
would be nice for those of us who don't understand the structure of image 
files: another common thread in all these packages is that the authors 
all appear to assume that everybody is an expert on image files and their 
contents.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#13169

FromJeff Higgins <jeff@invalid.invalid>
Date2012-03-25 12:59 -0400
Message-ID<jknipo$q6h$1@dont-email.me>
In reply to#13168
On 03/25/2012 12:46 PM, Martin Gregorie wrote:
>
> Just now I thought to look at Apache Commons and found the Sanselan
> package, which does a similar job to the javax.imagio.* stuff but as a
> free-standing package and, unlike them, it includes EXIF read/write
> abilities.
>
Great! Thanks for the tip.:)

[toc] | [prev] | [next] | [standalone]


#13171

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-03-25 17:15 +0000
Message-ID<jknjr1$tfb$4@localhost.localdomain>
In reply to#13169
On Sun, 25 Mar 2012 12:59:09 -0400, Jeff Higgins wrote:

> On 03/25/2012 12:46 PM, Martin Gregorie wrote:
>>
>> Just now I thought to look at Apache Commons and found the Sanselan
>> package, which does a similar job to the javax.imagio.* stuff but as a
>> free-standing package and, unlike them, it includes EXIF read/write
>> abilities.
>>
> Great! Thanks for the tip.:)

I meant to add the obligatory question: has anybody used Sanselan?
http://commons.apache.org/sanselan/ 

If so, I'd appreciate hearing about that.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#13173

FromJeff Higgins <jeff@invalid.invalid>
Date2012-03-25 14:08 -0400
Message-ID<jknmrt$kbc$1@dont-email.me>
In reply to#13171
On 03/25/2012 01:15 PM, Martin Gregorie wrote:
> On Sun, 25 Mar 2012 12:59:09 -0400, Jeff Higgins wrote:
>
>> On 03/25/2012 12:46 PM, Martin Gregorie wrote:
>>>
>>> Just now I thought to look at Apache Commons and found the Sanselan
>>> package, which does a similar job to the javax.imagio.* stuff but as a
>>> free-standing package and, unlike them, it includes EXIF read/write
>>> abilities.
>>>
>> Great! Thanks for the tip.:)
>
> I meant to add the obligatory question: has anybody used Sanselan?
> http://commons.apache.org/sanselan/
>
> If so, I'd appreciate hearing about that.
>
>
Well, just now.
Here's an interesting thread of discussion.
<http://www.mail-archive.com/user@commons.apache.org/msg07446.html>

[toc] | [prev] | [next] | [standalone]


#13175

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-03-25 18:34 +0000
Message-ID<jknog1$td$1@localhost.localdomain>
In reply to#13173
On Sun, 25 Mar 2012 14:08:34 -0400, Jeff Higgins wrote:

> On 03/25/2012 01:15 PM, Martin Gregorie wrote:
>> On Sun, 25 Mar 2012 12:59:09 -0400, Jeff Higgins wrote:
>>
>>> On 03/25/2012 12:46 PM, Martin Gregorie wrote:
>>>>
>>>> Just now I thought to look at Apache Commons and found the Sanselan
>>>> package, which does a similar job to the javax.imagio.* stuff but as
>>>> a free-standing package and, unlike them, it includes EXIF read/write
>>>> abilities.
>>>>
>>> Great! Thanks for the tip.:)
>>
>> I meant to add the obligatory question: has anybody used Sanselan?
>> http://commons.apache.org/sanselan/
>>
>> If so, I'd appreciate hearing about that.
>>
>>
> Well, just now.
> Here's an interesting thread of discussion.
> <http://www.mail-archive.com/user@commons.apache.org/msg07446.html>

Yep. That ties in pretty well with the state of the javadocs 
documentation for it. 


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#13172

FromKnute Johnson <nospam@knutejohnson.com>
Date2012-03-25 10:46 -0700
Message-ID<jknllo$9m4$1@dont-email.me>
In reply to#13146
On 3/24/2012 2:37 PM, Martin Gregorie wrote:
> Can anybody recommend a good EXIF tag handling Java package?
>
> I need to use it for reading and writing 'Comment' tags in at least JPG
> files, and preferably for more image types than just JPG. I found out, by
> experimenting with exiftool, that both PNG and GIF files also support the
> 'Comment' tag.
>
> I have found a couple of packages (Thang To's javaexif and Thomas Lane's
> Mediautil package), both dating from 2006 or so and both largely
> uncommented, which doesn't make them exactly easy to use.
>
>

Martin:

There used to be a big JAI/ImageIO users list that I belonged to several 
years ago.  I don't know if JAI is still relevant but I would think that 
would be a good place to look for EXIF info.

I found this website: http://java.net/projects/jai-imageio/.

Hope that helps.

-- 

Knute Johnson

[toc] | [prev] | [next] | [standalone]


#13174

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-03-25 18:13 +0000
Message-ID<jknn84$tfb$6@localhost.localdomain>
In reply to#13172
On Sun, 25 Mar 2012 10:46:32 -0700, Knute Johnson wrote:

> On 3/24/2012 2:37 PM, Martin Gregorie wrote:
>> Can anybody recommend a good EXIF tag handling Java package?
>>
>> I need to use it for reading and writing 'Comment' tags in at least JPG
>> files, and preferably for more image types than just JPG. I found out,
>> by experimenting with exiftool, that both PNG and GIF files also
>> support the 'Comment' tag.
>>
>> I have found a couple of packages (Thang To's javaexif and Thomas
>> Lane's Mediautil package), both dating from 2006 or so and both largely
>> uncommented, which doesn't make them exactly easy to use.
>>
>>
>>
> Martin:
> 
> There used to be a big JAI/ImageIO users list that I belonged to several
> years ago.  I don't know if JAI is still relevant but I would think that
> would be a good place to look for EXIF info.
> 
> I found this website: http://java.net/projects/jai-imageio/.
> 
Added to my list of Java image sources. Thanks.



-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#13176

From"John B. Matthews" <nospam@nospam.invalid>
Date2012-03-25 14:45 -0400
Message-ID<nospam-D45A44.14453125032012@news.aioe.org>
In reply to#13146
In article <jkleq5$dhh$1@localhost.localdomain>,
 Martin Gregorie <martin@address-in-sig.invalid> wrote:

> Can anybody recommend a good EXIF tag handling Java package? 
> 
> I need to use it for reading and writing 'Comment' tags in at least 
> JPG files, and preferably for more image types than just JPG. I found 
> out, by experimenting with exiftool, that both PNG and GIF files also 
> support the 'Comment' tag. 
> 
> I have found a couple of packages (Thang To's javaexif and Thomas 
> Lane's Mediautil package), both dating from 2006 or so and both 
> largely uncommented, which doesn't make them exactly easy to use.

For reference, ImageJ [1] includes the Exif_Reader [2] plugin, which is 
based on Drew Noakes' Exif Metadata Library. The plugin is read-only, 
but handy.

[1] <http://rsbweb.nih.gov/ij/> 
[2] <http://rsbweb.nih.gov/ij/plugins/exif-reader.html>
[3] <http://www.drewnoakes.com/code/exif>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

[toc] | [prev] | [next] | [standalone]


#13180

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-03-25 23:37 +0000
Message-ID<jkoa7u$4v4$1@localhost.localdomain>
In reply to#13176
Thanks to all of you who have responded. I should have enough information 
now to be able to dig into the issue of adding comments to images in the 
form of EXIF tags. 

Perhaps I should explain what I'm doing. I have a Java program, run 
overnight as a cron job, that can walk a directory tree and decorate it 
with a thumbnail of every new or modified image it finds. As I run an in-
house webserver, this is enough to let a PHP script generate on-the-fly 
menus from directories in the tree which contain clickable links to all 
files in the directory. Links to images display the thumbnail as part of 
that menu entry. However, this doesn't work if you simply point a browser 
at a local copy of the directory structure, so the Java program can also 
generate a linked set of static menus that work in the same way for 
people who don't run a web server. 

This is working reliably and well. It has met my design target of 
automatically indexing sets of images as they are dropped on a hard drive
so they can be scrolled through using smaller images that those can be 
selected so the full resolution image can be seen.

Now I'd like to display descriptions, when they are available,  under the 
thumbnails.

Thanks to all of you I now know that I can write a program to add the 
descriptions to the images as EXIF 'Comment' tags and in parallel I've 
checked that PHP can extract the content of those tags in order to add 
them to the on-the-fly menus and that Java can do the same for the static 
menus.

The only issue is speed: the PHP library routines to check that the image 
is the right type to have EXIF tags and to extract the tags require each 
image to be read several times: (1) to display the thumbnail, (2) to see 
if it is the right type to hold tags [this can probably be skipped] and 
(3) to extract the Comment tag's content. Currently only (1) happens, so 
I need to benchmark things to see if the PHP script is fast enough to 
support extracting captions from EXIF tags: this is not a consideration 
for the Java menu builder since this is never run when a user wants to 
see an list of images *right now*. 

If the PHP menu generator is unacceptably slow when dealing with EXIF 
tags, I'll use the aesthetically ugly trick of keeping the captions as a 
separate CSV list (filename,caption) which will probably be faster since 
at the start of the run it can be loaded into a Hashtable (Java) or 
associative array (PHP) once and will stay in memory while the menu 
builder is running.

Thanks again for your help.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#13189

FromLew <lewbloch@gmail.com>
Date2012-03-26 11:56 -0700
Message-ID<28354805.115.1332788170456.JavaMail.geo-discussion-forums@pbcpw7>
In reply to#13180
Martin Gregorie wrote:
> If the PHP menu generator is unacceptably slow when dealing with EXIF 
> tags, I'll use the aesthetically ugly trick of keeping the captions as a 
> separate CSV list (filename,caption) which will probably be faster since 
> at the start of the run it can be loaded into a Hashtable (Java) or 
> associative array (PHP) once and will stay in memory while the menu 
> builder is running.

I recommend against use of 'java.util.Hashtable' in favor of the modern (since 1998) 'Map' implementations.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#13194

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-03-26 19:48 +0000
Message-ID<jkqh6j$nla$1@localhost.localdomain>
In reply to#13189
On Mon, 26 Mar 2012 11:56:10 -0700, Lew wrote:

> Martin Gregorie wrote:
>> If the PHP menu generator is unacceptably slow when dealing with EXIF
>> tags, I'll use the aesthetically ugly trick of keeping the captions as
>> a separate CSV list (filename,caption) which will probably be faster
>> since at the start of the run it can be loaded into a Hashtable (Java)
>> or associative array (PHP) once and will stay in memory while the menu
>> builder is running.
> 
> I recommend against use of 'java.util.Hashtable' in favor of the modern
> (since 1998) 'Map' implementations.
>
Thanks for that. My normal default is to use a TreeMap. It maybe a bit 
slower, but its surprising how often the implied ordering turns out to be 
useful, if only for debugging.

I've just upgraded my PHP on-the-fly menu generator to display EXIF 
Copyright and Comment tags and given it a fairly thorough bashing. I've 
run it against fairly large lists of images, up to 300 photos averaging 
2.0 MB each, which don't yet contain either Copyright or Comment tags. 
Menu generation is a little slower than before, but not enough to be a 
show stopper, so I'll implement the bulk comment insertion program rather 
than using an external comments list. Game on!
   

-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#13195

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-03-26 19:52 +0000
Message-ID<jkqhd9$nla$2@localhost.localdomain>
In reply to#13189
On Mon, 26 Mar 2012 11:56:10 -0700, Lew wrote:

> Martin Gregorie wrote:
>> If the PHP menu generator is unacceptably slow when dealing with EXIF
>> tags, I'll use the aesthetically ugly trick of keeping the captions as
>> a separate CSV list (filename,caption) which will probably be faster
>> since at the start of the run it can be loaded into a Hashtable (Java)
>> or associative array (PHP) once and will stay in memory while the menu
>> builder is running.
> 
> I recommend against use of 'java.util.Hashtable' in favor of the modern
> (since 1998) 'Map' implementations.

Noted. I only considered Hashtable because they are favoured by some of 
the javax.imageio.* packages - scarecely surprising since most of these 
packages seem to have been around since at least Java 1.4.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#13198

FromLew <lewbloch@gmail.com>
Date2012-03-26 13:29 -0700
Message-ID<17521988.199.1332793740252.JavaMail.geo-discussion-forums@pbvs10>
In reply to#13195
On Monday, March 26, 2012 12:52:10 PM UTC-7, Martin Gregorie wrote:
> On Mon, 26 Mar 2012 11:56:10 -0700, Lew wrote:
> 
> > Martin Gregorie wrote:
> >> If the PHP menu generator is unacceptably slow when dealing with EXIF
> >> tags, I'll use the aesthetically ugly trick of keeping the captions as
> >> a separate CSV list (filename,caption) which will probably be faster
> >> since at the start of the run it can be loaded into a Hashtable (Java)
> >> or associative array (PHP) once and will stay in memory while the menu
> >> builder is running.
> > 
> > I recommend against use of 'java.util.Hashtable' in favor of the modern
> > (since 1998) 'Map' implementations.
> 
> Noted. I only considered Hashtable because they are favoured by some of 
> the javax.imageio.* packages - scarecely surprising since most of these 
> packages seem to have been around since at least Java 1.4.

Very, very surprising since the modern collections classes were introduced in Java 1.2 and the javax.imageio package in Java 1.4.

You should check the Javadocs.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#13201

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-03-26 21:58 +0000
Message-ID<jkqoqg$pmg$1@localhost.localdomain>
In reply to#13198
On Mon, 26 Mar 2012 13:29:00 -0700, Lew wrote:

> On Monday, March 26, 2012 12:52:10 PM UTC-7, Martin Gregorie wrote:
>> On Mon, 26 Mar 2012 11:56:10 -0700, Lew wrote:
>> 
>> > Martin Gregorie wrote:
>> >> If the PHP menu generator is unacceptably slow when dealing with
>> >> EXIF tags, I'll use the aesthetically ugly trick of keeping the
>> >> captions as a separate CSV list (filename,caption) which will
>> >> probably be faster since at the start of the run it can be loaded
>> >> into a Hashtable (Java)
>> >> or associative array (PHP) once and will stay in memory while the
>> >> menu builder is running.
>> > 
>> > I recommend against use of 'java.util.Hashtable' in favor of the
>> > modern (since 1998) 'Map' implementations.
>> 
>> Noted. I only considered Hashtable because they are favoured by some of
>> the javax.imageio.* packages - scarecely surprising since most of these
>> packages seem to have been around since at least Java 1.4.
> 
> Very, very surprising since the modern collections classes were
> introduced in Java 1.2 and the javax.imageio package in Java 1.4.
> 
> You should check the Javadocs.

I did: for some operations you need to use a filter which is based 
java.awt.image.ImageFilter. This gets passed properties via the
setProperties(Hashtable<?,?>) method.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.java.programmer


csiph-web