Project

General

Profile

jpeg2000 support

Added by Mateusz P. almost 9 years ago

Dear All,

recently I have been working with jpeg2000 format and would use some of Exiv2 method to handle operations.
Unfortunately, for jpeg2000 format are not available following:
1) Thumbnail Creation
2) Accessing preview images: http://dev.exiv2.org/projects/exiv2/wiki/Accessing_preview_images

Are there any plans to provide entire support for this format?

I would be happy if I could access the thumbnail or preview, meaning to access the smaller image data from this format.
Is there any workaround for that? Or I need to wait until the format will be fully support? (or not if it is not planned).


Replies (7)

RE: jpeg2000 support - Added by Robin Mills almost 9 years ago

Hi Mateusz

Adding JPEG 2000 support is a good idea. Google found this: http://en.wikipedia.org/wiki/JPEG_2000#Metadata

For traditional JPEG, additional metadata, e.g. lighting and exposure conditions, is kept in an application marker in the Exif format specified by the JEITA. JPEG 2000 chooses a different route, encoding the same metadata in XML form. The reference between the Exif tags and the XML elements is standardized by the ISO TC42 committee in the standard 12234-1.4.
.
Extensible Metadata Platform can also be embedded in JPEG 2000.

I think this is saying you should use XMP for meta-data in JPEG 2000. As our XMP support is provided using xmpsdk (created originally by Adobe), it's possible/likely that this is already working. To test this, I opened an image R.jpg in PhotoShop Elements (v6.0 from 2008 on MacOS-X) and saved it in JPEG2000 as R.jpf

$ exiv2 -pa ~/Desktop/R.jpf
Xmp.tiff.Orientation XmpText 1 top, left
...
$ exiv2 -pa ~/Desktop/R.jpf | grep Xmp | wc -l
55
$ exiv2 -pa ~/Desktop/R.jpg | wc -l
67

So for sure, lots of meta data was preserved and is accessible using XMP.

Robin

RE: jpeg2000 support - Added by Gilles Caulier almost 9 years ago

JPEG2000 support EXIF, IPTC and XMP. I implemented metadta registration through libjasper into digiKam image loader. Look code here :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/dimg/loaders/jp2kloader.cpp

Gilles Caulier

RE: jpeg2000 support - Added by Robin Mills almost 9 years ago

Thanks, Gilles.

I've never thought about this until this morning. Are you saying that JPEG2000 can include metadata in two ways:

1) embedded XML (and this is what your code is reading via libjasper)
2) XMP

Do you think we should add JPEG2000 support and use your code as a base for this effort?

Robin

RE: jpeg2000 support - Added by Gilles Caulier almost 9 years ago

Robin,

As i remember, when i implemented this JP2K loader, metadata are stored in separated chunck (as PNG for ex). Read JP2K specification. I take inspiration from ImageMagick loader code.

You cannot use as well my code in Exiv2. This code use libjpasper. In Exiv2, you need to be free of external decoder library dependency. You must implment a JP2K chunck analyser. It's not too complicated, because file format is really well documented by JPEG group.

Gilles Caulier

RE: jpeg2000 support - Added by Robin Mills almost 9 years ago

Thanks, Gilles. You are as helpful as always. Thanks for the update.

Mateusz:

In all honesty, I'm not willing to promise to do the work involved. During the summer of 2012, Abhinav contributed the video metadata support as a Google Summer of Code project. Maybe in 2013, a student will contribute JP2K support. For sure it's a good solid project for somebody to list on their resume/cv.

Robin

PS Best Wishes to you both for "The Holidays" and a Happy New Year in 2013.

RE: jpeg2000 support - Added by Mateusz P. almost 9 years ago

Thank you both for your responses.

Robin:
I tested already jpeg2000 support within the implementation of my test project. The metadata in XMP and EXIF is provided within Exiv2 lib.
My question was if there are any plans for the functionalities like:
1) Thumbnails
2) Preview
which works good and are very useful for regular jpeg and tiff formats.

Gilles:
Thank you for the proposition - I'll take a look on it. However a pure metadata EXIF and XMP are in a way implemented in Exiv2 lib what I mentioned above.
However I'll review the code you provide in order to find some way for thumbnail creation out of jpeg2000.

RE: jpeg2000 support - Added by Gilles Caulier almost 9 years ago

Mateusz,

However a pure metadata EXIF and XMP are in a way implemented in Exiv2 lib what I mentioned above.

i know, i implemented myself this code in the past (:=)))...

I don't think JP2K support preview. Perhaps there is a way in codec to extract a reduced version of image ad JPEG or PGF do... But in this case, you need codec to perform extract. It's a bad way.

In all case, IPTC preview is always available. We use it in digiKam to provide a quick view of JPEG2000 files (jasper lib use floating point computation and is very slow, compared to JPEG and PGF). In 99% of case IPTC preview is enough and very fast...

For thumbnails creation, you can use Exif thumbnail container... Simple and enough, but low quality...

Gilles Caulier

    (1-7/7)