Commit ddecf255 by Tuomas Riihimäki

Jpegreader

1 parent 70a195da
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<artifactId>commons-fileupload</artifactId> <artifactId>commons-fileupload</artifactId>
<version>1.3</version> <version>1.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.sshd</groupId> <groupId>org.apache.sshd</groupId>
<artifactId>sshd-core</artifactId> <artifactId>sshd-core</artifactId>
...@@ -85,7 +85,15 @@ ...@@ -85,7 +85,15 @@
<version>1.5.9</version> <version>1.5.9</version>
</dependency> </dependency>
</dependencies> </dependencies>
<repositories>
<repository>
<id>jvnet-nexus-releases</id>
<name>jvnet-nexus-releases</name>
<url>https://maven.java.net/content/repositories/releases/</url>
</repository>
</repositories>
</project> </project>
\ No newline at end of file
...@@ -74,11 +74,11 @@ public class JpegReader { ...@@ -74,11 +74,11 @@ public class JpegReader {
List<Segment> segments = parser.readSegments(byteSource, new int[] { 0xffee }, true); List<Segment> segments = parser.readSegments(byteSource, new int[] { 0xffee }, true);
if (segments != null && segments.size() >= 1) { if (segments != null && segments.size() >= 1) {
UnknownSegment app14Segment = (UnknownSegment) segments.get(0); UnknownSegment app14Segment = (UnknownSegment) segments.get(0);
byte[] data = app14Segment.bytes; byte[] data = app14Segment.getSegmentData();
if (data.length >= 12 && data[0] == 'A' && data[1] == 'd' && data[2] == 'o' && data[3] == 'b' && data[4] == 'e') if (data.length >= 12 && data[0] == 'A' && data[1] == 'd' && data[2] == 'o' && data[3] == 'b' && data[4] == 'e')
{ {
hasAdobeMarker = true; hasAdobeMarker = true;
int transform = app14Segment.bytes[11] & 0xff; int transform = data[11] & 0xff;
if (transform == 2) if (transform == 2)
colorType = COLOR_TYPE_YCCK; colorType = COLOR_TYPE_YCCK;
} }
......
...@@ -22,5 +22,6 @@ ...@@ -22,5 +22,6 @@
<attribute name="owner.project.facets" value="jst.web"/> <attribute name="owner.project.facets" value="jst.web"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!