You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Erlend Aakre <Er...@q-free.com> on 2011/12/08 13:38:45 UTC

[sanselan] Unable to read jpeg comment field

I have 2 images, one has almost no metadata (no EXIF), it just has the
JPEG Comment field set (not to be confused with the exif user comment
field).

When I try to read metadata from it:
IImageMetadata meta = Sanselan.getMetadata(file); 
it returns null.

The other picture is a picture from my camera (Canon EOS1000), which has
lots of metadata.

I've set the JPEG comment on this image with exiftool (exiftool
-comment=foo file.jpg), I read the metadata:
IImageMetadata meta = Sanselan.getMetadata(file);

the metadata is a JpegImageMetadata object, I go trough everything in
meta.getItems(), and meta.getExif().getAllField() without finding the
jpeg comment. meta.getPhotoshop() is empty, and meta.getRawImageData()
returns null.

Is there a way to get the JPEG comment with sanselan?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [sanselan] Unable to read jpeg comment field

Posted by Erlend Aakre <Er...@q-free.com>.
> If you can't check out and compile SVN, let me know and I can email you a
> new Sanselan JAR.
> 
> Regards
> Damjan

I've checked it out from svn, I tried building it with mvn -Prc package,
but that gives the following warning at first:

[WARNING] Some problems were encountered while building the effective
model for org.apache.commons:commons-sanselan:jar:0.98-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for
org.apache.maven.plugins:maven-idea-plugin is missing. @
org.apache.commons:commons-parent:17, /home/erlend/.m2/repository/org/apache/commons/commons-parent/17/commons-parent-17.pom, line 317, column 15
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they
threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support
building such malformed projects.

and the following tests fail:
Failed tests: 
testInsert(org.apache.sanselan.formats.jpeg.exif.ExifRewriteTest)
testRewriteLossy(org.apache.sanselan.formats.jpeg.exif.ExifRewriteTest)
testRewriteLossless(org.apache.sanselan.formats.jpeg.exif.ExifRewriteTest)


Mvn -version:
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /home/erlend/apache-maven-3.0.3
Java version: 1.6.0_21, vendor: Sun Microsystems Inc.
Java home: /home/erlend/jdk1.6.0_21/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-34-generic-pae", arch: "i386",
family: "unix"

No .jar files are generated in the target directory

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [sanselan] Unable to read jpeg comment field

Posted by Damjan Jovanovic <da...@gmail.com>.
No, Sanselan didn't have any way to read comments in the last released
version.

But I just committed a patch to SVN trunk (revision 1211882) that supports
reading JPEG comments with:
Sanselan.getImageInfo().getComments()

If you can't check out and compile SVN, let me know and I can email you a
new Sanselan JAR.

Regards
Damjan

On Thu, Dec 8, 2011 at 3:19 PM, Erlend Aakre <Er...@q-free.com>wrote:

> Here is the program I was using and the file that has metadata.
>
> 1test.jpg has only the JPEG Comment (view by using exiftool for
> example), when I run the attached ExifTest.java program I get a null
> metadata object.
>
> vegas.jpg is from a camera, I get metadata but can not find the comment
> (JPEG COM) anywhere in it
>
> Regards
> Erlend
>
> >
> > I'm checking. If not, I'll make you a patch. Can you email me an image to
> > test with?
> >
> > Regards
> > Damjan
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

Re: [sanselan] Unable to read jpeg comment field

Posted by Erlend Aakre <Er...@q-free.com>.
Here is the program I was using and the file that has metadata.

1test.jpg has only the JPEG Comment (view by using exiftool for
example), when I run the attached ExifTest.java program I get a null
metadata object.

vegas.jpg is from a camera, I get metadata but can not find the comment
(JPEG COM) anywhere in it

Regards
Erlend

> 
> I'm checking. If not, I'll make you a patch. Can you email me an image to
> test with?
> 
> Regards
> Damjan


Re: [sanselan] Unable to read jpeg comment field

Posted by Damjan Jovanovic <da...@gmail.com>.
On Thu, Dec 8, 2011 at 2:38 PM, Erlend Aakre <Er...@q-free.com>wrote:

> I have 2 images, one has almost no metadata (no EXIF), it just has the
> JPEG Comment field set (not to be confused with the exif user comment
> field).
>
> When I try to read metadata from it:
> IImageMetadata meta = Sanselan.getMetadata(file);
> it returns null.
>
> The other picture is a picture from my camera (Canon EOS1000), which has
> lots of metadata.
>
> I've set the JPEG comment on this image with exiftool (exiftool
> -comment=foo file.jpg), I read the metadata:
> IImageMetadata meta = Sanselan.getMetadata(file);
>
> the metadata is a JpegImageMetadata object, I go trough everything in
> meta.getItems(), and meta.getExif().getAllField() without finding the
> jpeg comment. meta.getPhotoshop() is empty, and meta.getRawImageData()
> returns null.
>
> Is there a way to get the JPEG comment with sanselan?
>

I'm checking. If not, I'll make you a patch. Can you email me an image to
test with?

Regards
Damjan