Tutorials

Reading and writing JPEG metadata (EXIF) from Java with Sanselan

Recently I had a need to be able to work with EXIF image metadata in JPEG files from Java. First, some background, then, some code.

Jpg image with EXIF - bike

Sample image I used, lots of EXIF info on this shot of a 1971 SL70 that I am rebuilding.

I started by looking at JAI-imageio, which is the current home of the old Sun JAI project (to be fair, that and more), but I couldn't readily figure out how to use it to write EXIF data. The capability might be there, but I couldn't find any substantive documentation or examples (apart from JavaDocs, which are useful yes, but I needed more hand holding to start out). When I ran into this basic getting started stumbling block I broadened my search.

From there I found several third party libraries. Most notable where Metadata Extractor, and Sanselan.

Debugging external Java processes with Eclipse (GWT example)

Many modern IDEs have all sorts of support for running applications, even servers, in process with the IDE; and then debugging from there. It's good to also be aware, however, that you can debug *external* processes pretty easily as well. This is made possible by the Java Platform Debugger Architecture.

bug

Gwittir Demo, Part 2. Adding Tags.

In the last post we made a real simple flickr browser. Now I am going to modify it to support tags on the search. You can see the results here.

There is now a text box where you can type comma delimited sets of tags to search flickr for. (Hit return to update the results) This feature demonstrates the use of the Converter interface in bindings. We want to bind the TextBox to the "tags" property on the FlickrSearch bean, so we use a converter to split the tags:

  

Neat Gwittir Demo

A Flickr Browser. Mindnumbingly easy! Code below the fold.

Doing the Google Web Toolkit -noserver thing

The GWTShell -noserver option has caused some confusion on the GWT forums. This option is intended to allow you to run an external Java servlet container instance (be it Tomcat or anything else) while doing development and using the GWTShell with "Hosted Mode."

GWT RPC with DataSource and Hosted Mode example

I updated the "sample example that is quite ample" earlier this week, forgot to note it here.

The sample is a GWT RPC example that now includes using a DataSource with an HSQL database. This example shows you how to set things up to work in Hosted Mode (with the "Tomcat Lite" that comes with GWT) and how to deploy a WAR.

Along with basic GWT RPC and a DataSource it also demonstrates throwing exceptions across the wire, custom serializable types, how to configure web.xml and context.xml - an

Charlie's super short JPA example

I will try to expand on this later, but for now I do not have time and wanted to get something on this subject recorded, so here is an ultra short example of using JPA with JEE5 outside of a container.

I used the Oracle Toplink JPA Implementation - they also have some tutorials there, but like many others they get into too much other crap, building a web app, etc.

1. Setup a database and make sure you can access it with the correct perms over the network (I used MySQL and ConnectorJ).



Syndicate content