Git Product home page Git Product logo

twelvemonkeys's People

Contributors

actinium15 avatar ankon avatar astappiev avatar bchapuis avatar bernhardf-ro avatar ckovorodkin avatar daaaaa avatar dependabot[bot] avatar gotson avatar guinotphil avatar hamnis avatar haraldk avatar joycebrum avatar justwrote avatar koendg avatar lokling avatar paulvi avatar pvorb avatar runebr avatar schmidor avatar seafraf avatar shihabuddin avatar simon04090 avatar snyk-bot avatar steinarb avatar trygvis avatar wladimirleite avatar younseunghyun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twelvemonkeys's Issues

mvn package - test failure - testGetTypeSpecifiers - OpenJDK/LCMS

I can't seem to get a successful build on Ubuntu 14.04 or Fedora 20, I am getting the same failed tests, if this normal? Am I doing something wrong?

Java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (fedora-2.4.4.1.fc20-x86_64 u51-b02)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)

export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"
mvn -e package

tail of mvn output:


T E S T S

Running com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderTest
WARNING: Reading reference metadata failed for TestData: file:/home/csyperski88/Downloads/TwelveMonkeys-master/imageio/imageio-jpeg/target/test-classes/jpeg/cmyk-sample.jpg image 0: Inconsistent metadata read from stream
WARNING: Reading reference metadata failed for TestData: file:/home/csyperski88/Downloads/TwelveMonkeys-master/imageio/imageio-jpeg/target/test-classes/jpeg/cmyk-sample-multiple-chunk-icc.jpg image 0: Image format Error
WARNING: Test skipped due to reader.getRawImageType(0) returning null
Tests run: 95, Failures: 2, Errors: 0, Skipped: 3, Time elapsed: 5.806 sec <<< FAILURE!
Running com.twelvemonkeys.imageio.plugins.jpeg.JFIFThumbnailReaderTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
Running com.twelvemonkeys.imageio.plugins.jpeg.JPEGSegmentImageInputStreamTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.018 sec
Running com.twelvemonkeys.imageio.plugins.jpeg.JFXXThumbnailReaderTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec
Running com.twelvemonkeys.imageio.plugins.jpeg.EXIFThumbnailReaderTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 sec
Running com.twelvemonkeys.imageio.plugins.jpeg.FastCMYKToRGBTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.061 sec
Running com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageWriterTest
Tests run: 16, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.09 sec <<< FAILURE!

Results :

Failed tests: testGetTypeSpecifiers(com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderTest): ImageTypeSepcifier from getRawImageType should be in the iterator from getImageTypes
testSetDestinationType(com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderTest): Could not read file:/home/csyperski88/Downloads/TwelveMonkeys-master/imageio/imageio-jpeg/target/test-classes/jpeg/cmm-exception-adobe-rgb.jpg with explicit destination type javax.imageio.ImageTypeSpecifier$Interleaved@2a0e3919
testWrite(com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageWriterTest): Invalid argument to native writeImage

Tests run: 138, Failures: 3, Errors: 0, Skipped: 3

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Twelvemonkeys ..................................... SUCCESS [0.254s]
[INFO] TwelveMonkeys :: Common ........................... SUCCESS [0.007s]
[INFO] TwelveMonkeys :: Common :: Language support ....... SUCCESS [1.937s]
[INFO] TwelveMonkeys :: Common :: IO ..................... SUCCESS [3.161s]
[INFO] TwelveMonkeys :: Common :: Image .................. SUCCESS [1.671s]
[INFO] TwelveMonkeys :: Servlet .......................... SUCCESS [3.851s]
[INFO] TwelveMonkeys :: ImageIO .......................... SUCCESS [0.007s]
[INFO] TwelveMonkeys :: ImageIO :: Core .................. SUCCESS [0.644s]
[INFO] TwelveMonkeys :: ImageIO :: Metadata .............. SUCCESS [0.671s]
[INFO] TwelveMonkeys :: ImageIO :: ICO plugin ............ SUCCESS [1.023s]
[INFO] TwelveMonkeys :: ImageIO :: ICNS plugin ........... SUCCESS [0.730s]
[INFO] TwelveMonkeys :: ImageIO :: IFF plugin ............ SUCCESS [1.522s]
[INFO] TwelveMonkeys :: ImageIO :: JPEG plugin ........... FAILURE [6.178s]
[INFO] TwelveMonkeys :: ImageIO :: PDF plugin ............ SKIPPED
[INFO] TwelveMonkeys :: ImageIO :: PICT plugin ........... SKIPPED
[INFO] TwelveMonkeys :: ImageIO :: PSD plugin ............ SKIPPED
[INFO] TwelveMonkeys :: ImageIO :: Thumbs.db plugin ...... SKIPPED
[INFO] TwelveMonkeys :: ImageIO :: TIFF plugin ........... SKIPPED
[INFO] TwelveMonkeys :: ImageIO :: Batik Plugin .......... SKIPPED
[INFO] TwelveMonkeys :: ImageIO :: JMagick Plugin ........ SKIPPED
[INFO] TwelveMonkeys :: ImageIO :: reference test cases .. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.981s
[INFO] Finished at: Mon Jan 27 08:59:19 CST 2014
[INFO] Final Memory: 29M/303M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project imageio-jpeg: There are test failures.
[ERROR]
[ERROR] Please refer to /home/csyperski88/Downloads/TwelveMonkeys-master/imageio/imageio-jpeg/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project imageio-jpeg: There are test failures.

Please refer to /home/csyperski88/Downloads/TwelveMonkeys-master/imageio/imageio-jpeg/target/surefire-reports for the individual test results.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /home/csyperski88/Downloads/TwelveMonkeys-master/imageio/imageio-jpeg/target/surefire-reports for the individual test results.
at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:87)
at org.apache.maven.plugin.surefire.SurefirePlugin.writeSummary(SurefirePlugin.java:641)
at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:615)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:137)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:98)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :imageio-jpeg

Null Pointer Exception when JPEG has got two SOI markers.

First I want to thanks TwelveMonkeys to provide such library.
Recently, I am facing following Null Pointer Exception while reading them. Attaching the images

StackTrace with twelvemonkey jpeg plugin:
java.lang.NullPointerException
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.getSourceCSType(Unknown Source)
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
at javax.imageio.ImageIO.read(ImageIO.java:1448)
at javax.imageio.ImageIO.read(ImageIO.java:1308)

StackTrace without twelvemonkey jpeg plugin:
javax.imageio.IIOException: Invalid JPEG file structure: two SOI markers
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(Native Method)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(JPEGImageReader.java:604)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly(JPEGImageReader.java:342)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(JPEGImageReader.java:476)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(JPEGImageReader.java:597)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1054)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:1034)
at javax.imageio.ImageIO.read(ImageIO.java:1448)
at javax.imageio.ImageIO.read(ImageIO.java:1308)

05
11 1

Subsampling in JPEGImageReader may result in black last line

Fixing #39 revealed another issue:

The last line of subsampled images may turn out black. The issue can be shown by running the tests:

JPEGImageReaderTest.testReadSubsamplingNotSkippingLines1025()

and

JPEGImageReaderTest.testReadSubsamplingNotSkippingLines1028()

(currently @Ignoreed).

Resizing of images with ResampleOp.filter slow on WebSphere 8.5.5

I have an performance issue with resizing images in WebSphere 8.5.5. Previously my web app was deployed on Tomcat 7.0.50, and resizing was working just fine. Please check my Q & A on stackoverflow for move info: http://stackoverflow.com/questions/21093470/imageio-read-write-slow-in-websphere-8-5-5/21097980#21097980

Here is the one of test images I've used & a snapshot from JProfiler
testimage

jprofiler cpu data

EDIT:
I've run couple of more profilings, and the problematic methods are following (for Tomcat & WebSpehre on IBM JVM):

ResampleOp.resample:
java.awt.image.Raster.getSample
java.awt.image.WritableRaster.getSample

I must have had some filters turned on on my initial profilings

Creation of *source.jar in phase "package"

I was missing the *source.jar files.

mvn.bat source:jar package

did the right thing, but the comment
<!-- THIS DOES NOT WORK..?! -->
in pom.xml suggests that

mvn.bat package

should do it automatically.

http://stackoverflow.com/questions/10483180/maven-what-is-pluginmanagement

gave the answer: Moved

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                 <inherited>true</inherited>
                 <executions>
                     <execution>
                         <phase>package</phase>
                         <id>attach-sources</id>
                         <goals>
                             <goal>jar</goal>
                             <goal>test-jar</goal>
                         </goals>
                     </execution>
                 </executions>
             </plugin>

from <build><pluginManagement><plugins> to <build><plugins> .

Many thanks to you Harald, TwelveMonkeys saved my day.

imageio-jpeg convert CMYK to RGB: color is off

Hi,

I'm using latest snapshot of imageio-jpeg to convert CMYK jpg to RGB, but the resulting jpg's color is off, it's darker than the original, what is the best way to debug this? I added warning listener to reader and writer, but didn't receive any warnings.

Thanks

JMagick not available

Hi,
I wanted to use the packages to improve imageio.
I downloaded all the packages. I can read the images correctly, but I have an error during the initialization:
Could not instantiate SVGImageReader (missing support classes).
java.lang.NoClassDefFoundError: org/apache/batik/transcoder/TranscoderException
at com.twelvemonkeys.imageio.plugins.svg.SVGImageReaderSpi.onRegistration(Unknown Source)
at javax.imageio.spi.SubRegistry.registerServiceProvider(ServiceRegistry.java:715)
at javax.imageio.spi.ServiceRegistry.registerServiceProvider(ServiceRegistry.java:302)
at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:211)
at javax.imageio.spi.IIORegistry.(IIORegistry.java:138)
at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:159)
at javax.imageio.ImageIO.(ImageIO.java:65)
at imageTiTi.ImageIO.Read(ImageIO.java:174)
at imageTiTi.ImageIO.Read(ImageIO.java:158)
at prototyper.Prototyper.main(Prototyper.java:324)
Caused by: java.lang.ClassNotFoundException: org.apache.batik.transcoder.TranscoderException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 10 more
JMagick not available: java.lang.NoClassDefFoundError: magick/MagickImage
Make sure JMagick libraries are available in java.library.path. Current value:
"/Applications/NetBeans/NetBeans 8.0.app/Contents/Resources/NetBeans/webcommon/bin::/Users/FiReTiTi/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."

But even if there is this error, I can read the images.
But how can I fix this error?
Thank for your help.

twelvemonkey not in front

Documentation:
"The TwelveMonkeys service providers for TIFF and JPEG overrides the onRegistration method, and utilizes the pairwise partial ordering mechanism of the IIOServiceRegistry to make sure it is installed before the Sun/Oracle provided JPEGImageReader and the Apple provided TIFFImageReader on OS X, respectively. "

Code:

Iterator jpegReaders = ImageIO.getImageReadersByFormatName("JPEG");
while (jpegReaders.hasNext()) {
System.out.println("jpeg reader: " + jpegReaders.next());
}
Iterator tiffReaders = ImageIO.getImageReadersByFormatName("TIFF");
while (tiffReaders.hasNext()) {
System.out.println("tiff reader: " + tiffReaders.next());
}

result:
jpeg reader: com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader@5dadd1c5
jpeg reader: com.sun.imageio.plugins.jpeg.JPEGImageReader@4929a06b
tiff reader: com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader@247ab39
tiff reader: com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReader@5f3f333c

So the tiff reader isn't in front :-( Or does the documentation mean that it only applies to OSX?

TIFF write support

Write support for Baseline TIFF.

Popular extensions:

  • LZW
  • JPEG ("new style" only)
  • 16 bit signed data?

PNG Version + Byte Buffer version

Hi

I like your project and I intend on using it in my java 3D game engine which is in its early stages, I was wondering if you were going to produce your own version of the PNG loader? I have my own version and speed wise it is 3-4 times faster than the ImageIO reader that comes with Java

Also do you have any intension of creating a ByteBuffer version of your readers? Ie it loads directly in to a byte buffer and and skips the ImageIO API? This would be for people wanting to load images directly in to a 3D renderer, this might increase speed dramatically.

Thanks

Peter

imageio-jpeg does not handle IIOMetaData

I'm currently trying to convert a CMYK jpeg to an RGB one while preserving its meta data. Then i recognized that JPEGImageReader.getImageMetadata(...) method always returns null.

Release 3.0

As far as I understood, support for CMYK-Jpegs will come with 3.0. This is the main reason I would really like to see a releas soon ;)
Since I could not find a maven repo containing 3.0-SNAPSHOT, I will now have to build my own and deploy to our internal nexus...

Netbeans versus without Netbeans

Hello,
I use the Netbeans IDE with JDK 7.1.60, added the jar to the library and the program works perfectly in NetBeans environment, but when I run outside the IDE does not work.

Iterator readers = ImageIO.getImageReadersByFormatName ("PSD");
while (readers.hasNext ()) {
System.out.println ("reader:" + readers.next ());
}
Returns nothing.

Can you help me?

Thank you

Sergio

Build problems

Hi, I'm primarily interested in the imageio-jpeg plugin and was trying to build the whole imageio project, 3.0-SNAPSHOT. Maybe I don't know what I'm doing, but when I build the project, I get a failure on the IFF plugin. Skipping tests doesn't seem to help either.
If it helps, here's the maven error:

com.twelvemonkeys.imageio.plugins.iff.IFFImageReaderTest

Failed tests: testWriteReadCompare(com.twelvemonkeys.imageio.plugins.iff.IFFImageWriterTest): Failure writing test data 0 java.io.EOFException

Thanks!

JPEGImageReaderTest#testReadSubsamplingBounds{1024,1026,1027} failing

On revision e3bab84 I have these tests failing:

-------------------------------------------------------------------------------
Test set: com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderTest
-------------------------------------------------------------------------------
Tests run: 104, Failures: 3, Errors: 0, Skipped: 5, Time elapsed: 2.124 sec <<< FAILURE!
testReadSubsamplingBounds1027(com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderTest)  Time elapsed: 0.041 sec  <<< FAILURE!
java.lang.AssertionError: expected:<16711421> but was:<16711677>
    at org.junit.Assert.fail(Assert.java:91)
    at org.junit.Assert.failNotEquals(Assert.java:645)
    at org.junit.Assert.assertEquals(Assert.java:126)
    at org.junit.Assert.assertEquals(Assert.java:470)
    at org.junit.Assert.assertEquals(Assert.java:454)
    at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderTest.testReadSubsamplingBounds1027(Unknown Source)
...
testReadSubsamplingBounds1026(com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderTest)  Time elapsed: 0.034 sec  <<< FAILURE!
java.lang.AssertionError: expected:<16711421> but was:<16711677>
    at org.junit.Assert.fail(Assert.java:91)
    at org.junit.Assert.failNotEquals(Assert.java:645)
    at org.junit.Assert.assertEquals(Assert.java:126)
    at org.junit.Assert.assertEquals(Assert.java:470)
    at org.junit.Assert.assertEquals(Assert.java:454)
    at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderTest.testReadSubsamplingBounds1026(Unknown Source)
...
testReadSubsamplingBounds1024(com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderTest)  Time elapsed: 0.022 sec  <<< FAILURE!
java.lang.AssertionError: expected:<16711421> but was:<16711677>
    at org.junit.Assert.fail(Assert.java:91)
    at org.junit.Assert.failNotEquals(Assert.java:645)
    at org.junit.Assert.assertEquals(Assert.java:126)
    at org.junit.Assert.assertEquals(Assert.java:470)
    at org.junit.Assert.assertEquals(Assert.java:454)
    at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderTest.testReadSubsamplingBounds1024(Unknown Source)
...

Java is

java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

(same failures also with 1.7.0_45, and with 1.8.0-b129 under KCMS, see #41 )

The machine in question is a Fedora 20 x86_64 system.

JPEG 3-channel component ID = 0-2 YCbCr (using RGB)

Hi,

First of all thanks for this great library, it helped me overcome already many issues with images.

I'm currently working with one type of image that appears to be YCbCr, but RGB model is used. Example images are:

4ss0332-014
2)
14-0281-054_1

These images seem to be created by Photoshop and have :
startOfFrame.components[0].id == 0
startOfFrame.components[1].id == 1
startOfFrame.components[2].id == 2

Therefore, in JPEGImageReader.java I have changed the if statement on line 569 from
if (startOfFrame.components[0].id == 1 && startOfFrame.components[1].id == 2 && startOfFrame.components[2].id == 3) {

to

if ((startOfFrame.components[0].id == 0 && startOfFrame.components[1].id == 1 && startOfFrame.components[2].id == 2) || (startOfFrame.components[0].id == 1 && startOfFrame.components[1].id == 2 && startOfFrame.components[2].id == 3)) {

in order to select return JPEGColorSpace.YCbCr.

Would you be willing to apply this patch?

Best regards,
Boris

Extract Clipping Path from TIFF Image

It would be very useful if your TIFF ImageIO plugin could also extract Clipping Paths that are embedded in the TIFF Header and return a Shape object or even the raw SVG. This Shape or SVG Markup could then be used to add an Alpha Channel when converting TIFFs to other formats that support an Alpha Channel - like PNGs.

ImageIO.getImageWriter(reader) not working inside tomcat

Hello Harald,

I wrote a basic test code that does work in a standalone test class:

public class Test
{

public static void main(String[] arg)
{
    try
    {
        ImageInputStream iis = ImageIO.createImageInputStream(new FileInputStream(arg[0]));
        Iterator<ImageReader> readers = ImageIO.getImageReaders(iis);
        if (!readers.hasNext())
            throw new IOException("can't decode this image inputstream");

        ImageReader reader = readers.next();
        ImageReadParam param = reader.getDefaultReadParam();
        reader.setInput(iis, true, true);
        BufferedImage img = reader.read(0, param);

        ImageWriter writer = ImageIO.getImageWriter(reader);

        if (writer == null)
            throw new IOException("can't find writer, reader provider: " + reader.getOriginatingProvider());

        System.out.println("Writer: " + writer.getClass());
    }
    catch (Throwable t)
    {
        t.printStackTrace();
    }
}

}

The same code doesn't work inside a tomcat webapp, writer is null so an exception is thrown.

I have:

  • added the listener as described in the guide
  • fixed class name typos inside JPEGImageWriterSpi (class names were not starting with "com"

I have verified with a test loop that the ImageWriter is loaded:

static
{
    System.out.println("ImageIO, looking for writers");

    Iterator<ImageWriter> ite = ImageIO.getImageWritersByFormatName("jpeg");

    while (ite.hasNext())
        System.out.println("ImageIO writer: " + ite.next().getClass());
}

And the result:

logs/catalina.out:ImageIO, looking for writers
logs/catalina.out:ImageIO writer: class com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageWriter
logs/catalina.out:ImageIO writer: class com.sun.imageio.plugins.jpeg.JPEGImageWriter

Any idea about why is not working just inside tomcat? How to debug further?

Thanks,

Daniele.

CMMException when parsing jpeg

Hi Harald,

I've been using TwelveMonkeys successfully, but I found an image that causes problems (attached and linked):

http://25.media.tumblr.com/77f31c36ea8f46ad1f41d6c6f02c60a8/tumblr_n0ccizPvsK1smx7x5o5_1280.jpg

tumblr_n0ccizpvsk1smx7x5o5_1280

When I try to read in that image, I get the following exception:

java.awt.color.CMMException: General CMM error517
    at sun.java2d.cmm.kcms.CMM.checkStatus(CMM.java:180)
    at sun.java2d.cmm.kcms.CMM.createTransform(CMM.java:134)
    at java.awt.image.ColorConvertOp.filter(ColorConvertOp.java:540)
    at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.readImageAsRasterAndReplaceColorProfile(Unknown Source)
    at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
    at javax.imageio.ImageIO.read(ImageIO.java:1448)
    at javax.imageio.ImageIO.read(ImageIO.java:1308)
...

This may be related to this java bug:
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6444360

And here's another image I found that causes the same problem, in case that helps:
http://lh6.ggpht.com/_zhJGGuLhHrQ/Ro6SIyBE_TI/AAAAAAAAAA4/PWx6LzckCSs/Flower+-+GalleryPlayer.jpg

missing icc_profiles_lnx files

I am getting this error when running mvn package:
java.io.FileNotFoundException: com/twelvemonkeys/imageio/color/icc_profiles_lnx.properties or com/twelvemonkeys/imageio/color/icc_profiles_lnx.xml

I cannot find these files in the source... How can I get them?

Dependency failed

Good day,
added

com.twelvemonkeys.imageio imageio-jpeg 3.0-SNAPSHOT

when I am trying to run project getting:
[WARNING] The POM for com.twelvemonkeys.imageio:imageio-jpeg:jar:3.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
...
[ERROR] Failed to execute goal on project: Could not resolve dependencies for project com.test:war:1.1.2: Failure to find com.twelvemonkeys.imageio:imageio-jpeg:jar:3.0-SNAPSHOT in http://repository.apache.org/content/groups/snapshots-group/ was cached in the local repository, resolution will not be reattempted until the update interval of apache.snapshots has elapsed or updates are forced -> [Help 1]

ColorSpacesTest#testCorbisRGBSpecialHandling() fails with JDK8/LCMS

When building with JDK 8 (b129) the ColorSpacesTest#testCorbisRGBSpecialHandling() fails:

-------------------------------------------------------------------------------
Test set: com.twelvemonkeys.imageio.color.ColorSpacesTest
-------------------------------------------------------------------------------
Tests run: 18, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.067 sec <<< FAILURE!
testCorbisRGBSpecialHandling(com.twelvemonkeys.imageio.color.ColorSpacesTest)  Time elapsed: 0.007 sec  <<< FAILURE!
java.lang.AssertionError: array lengths differed, expected.length=452 actual.length=420
    at org.junit.Assert.fail(Assert.java:91)
    at org.junit.internal.ComparisonCriteria.assertArraysAreSameLength(ComparisonCriteria.java:72)
    at org.junit.internal.ComparisonCriteria.arrayEquals(ComparisonCriteria.java:36)
    at org.junit.Assert.internalArrayEquals(Assert.java:414)
    at org.junit.Assert.assertArrayEquals(Assert.java:200)
    at org.junit.Assert.assertArrayEquals(Assert.java:213)
    at com.twelvemonkeys.imageio.color.ColorSpacesTest.testCorbisRGBSpecialHandling(Unknown Source)

This seems to be caused by the use of LCMS in JDK8, while earlier JDKs use kcms. The test can be made to pass by using the JVM arguments to switch back to kcms:

-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider

Unofrtunately I cannot get my JDK 1.7.0u45 to use LCMS to check in the other direction.

Remove deprecation warnings from build (direct use of Oracle/Sun JPEGImageReader)

Currently the build creates a few of these warnings:

/.../twelvemonkeys/imageio/imageio-tiff/src/main/java/com/twelvemonkeys/imageio/plugins/tiff/TIFFImageReader.java:31: warning: JPEGImageReader is internal proprietary API and may be removed in a future release
import com.sun.imageio.plugins.jpeg.JPEGImageReader;
^

We should rewrite to use the service lookup mechanism to instantiate these in readers that delegate to the com.sun...JPEGImageReader.

For the tests, perhaps just annotate with @Deprecated as we really mean to use these classes, alternatively use some reflection.

Twelvemonkeys ImageIO reader not available on Centos but available on windows

Good day,

I have an issue implementing your wonderful solution to my server, and would appreciate if u can help me with it.

  1. I built all the libraries locally. Here are my dependencies:

<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-core</artifactId>
<version>${twelvemonkey.version}</version>
<scope>system</scope>
<systemPath>${repo.local.path}twelvemonkeys-imageio-core-3.0-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-common</artifactId>
<version>${twelvemonkey.version}</version>
<scope>system</scope>
<systemPath>${repo.local.path}twelvemonkeys-common-lang-3.0-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-metadata</artifactId>
<version>${twelvemonkey.version}</version>
<scope>system</scope>
<systemPath>${repo.local.path}twelvemonkeys-imageio-metadata-3.0-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-jpeg</artifactId>
<version>${twelvemonkey.version}</version>
<scope>system</scope>
<systemPath>${repo.local.path}twelvemonkeys-imageio-jpeg-3.0-SNAPSHOT.jar</systemPath>
</dependency>

  1. Everything seems to be working locally on windows 7, java: 1.7.0_06-b24
    I get in log this list of IOReaders:
    [2013-12-10 19:52:34,996] [INFO ] [http-bio-8080-exec-3] ImageModel [184]: ImageIO reader: com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader@247f1358
    [2013-12-10 19:52:34,997] [INFO ] [http-bio-8080-exec-3] ImageModel [184]: ImageIO reader: com.sun.imageio.plugins.jpeg.JPEGImageReader@2e7ed301
  2. The problem appears to be when I deploy to the server. Which has Centos and same java version. I get just this.
    [2013-12-10 19:36:38,384] [INFO ] [http-bio-8080-exec-6] ImageModel [184]: ImageIO reader: com.sun.imageio.plugins.jpeg.JPEGImageReader@14e8949

Server detailed info:

OS: OS Linux unknown, amd64/64 (8 cores)
Java: Java(TM) SE Runtime Environment, 1.7.0_06-b24
JVM: Java HotSpot(TM) 64-Bit Server VM, 23.2-b09, mixed mode
PID of process: 2469
Nb of opened files 66 / 1,024 ++++++++++++
Server: Server Apache Tomcat/7.0.29
Webapp context:
Start: 12/8/13 11:17 PM
JVM arguments: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
-Xms1024M
-Xmx4096M
-XX:MaxPermSize=512M
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.endorsed.dirs=/opt/tomcat/endorsed
-Dcatalina.base=/opt/tomcat
-Dcatalina.home=/opt/tomcat
-Djava.io.tmpdir=/opt/tomcat/temp
Mean age of http sessions (min): 108
Tomcat "http-bio-8080": Busy threads = 6 / 200 ++++++++++++
Bytes received = 1,358,977
Bytes sent = 272,220,893
Request count = 25,095
Error count = 918
Sum of processing times (ms) = 3,589,889
Max processing time (ms) = 923,266
Memory: Non heap memory = 118 Mb (Perm Gen, Code Cache),
Loaded classes = 14,701,
Garbage collection time = 38,065 ms,
Process cpu time = 4,432,390 ms,
Committed virtual memory = 5,530 Mb,
Free physical memory = 306 Mb,
Total physical memory = 32,162 Mb,
Free swap space = 3,914 Mb,
Total swap space = 3,914 Mb
Perm Gen memory: 97 Mb / 512 Mb ++++++++++++

Please let me know if u need more info. Thank you very much for your help.

NPE in JPEGImageReader.getImageMetadata()

I get this NPE with a particular image with CMYK and an embedded ICC profile. It happens in jpegVariety.getFirstChild().appendChild(app2ICC). The firstChild in the jpegVariety is null. Could this be an issue with the image? Is there a way to attach the image?

Wrong JPEG color space

Apparently TwelveMonkeys and JDK have exchanged seats: the com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader confuses JPEG color space while JDK produces adequate result.

The test:

val img = ImageIO.read(new File("/home/andrey/Downloads/tailand.jpg"))
ImageIO.write(img, "JPG", new File("/tmp/thumbnail.jpg"))

Original image (link):
tailand
Result:
thumbnail

java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

TwelveMonkeys: 3.0-rc5

Maven RC artifacts

Is there any reason some artifacts like imageio-icns are still "RC" after a few months?

I want to use some of them in a project, but we are not allowed to use any artifact with a version different than "X.Y.Z" (to avoid SNAPSHOTs and other strange names)

Can those be re-released as final already?

NullPointerException while reading image

I get the following exception while try to read the attached, some may say odd ;-) image:

java.lang.NullPointerException
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.getAppSegments(JPEGImageReader.java:619)
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.getEmbeddedICCProfile(JPEGImageReader.java:724)
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:270)
at javax.imageio.ImageReader.read(ImageReader.java:923)

icc_problem2

ConcurrentModificationException in IIOProviderContextListener#contextDestroyed()

Dec 30, 2013 4:39:01 PM org.apache.catalina.core.ApplicationContext log
INFO: Unregistered locally installed provider class: class com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageWriterSpi
Dec 30, 2013 4:39:01 PM org.apache.catalina.core.ApplicationContext log
INFO: Unregistered locally installed provider class: class com.twelvemonkeys.imageio.plugins.psd.PSDImageReaderSpi
Dec 30, 2013 4:39:01 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class com.twelvemonkeys.servlet.image.IIOProviderContextListener
java.util.ConcurrentModificationException
    at java.util.HashMap$HashIterator.nextEntry(HashMap.java:806)
    at java.util.HashMap$ValueIterator.next(HashMap.java:835)
    at javax.imageio.spi.FilterIterator.advance(ServiceRegistry.java:809)
    at javax.imageio.spi.FilterIterator.next(ServiceRegistry.java:828)
    at com.twelvemonkeys.servlet.image.IIOProviderContextListener.contextDestroyed(Unknown Source)
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4763)
    at org.apache.catalina.core.StandardContext$4.run(StandardContext.java:5472)
    at java.lang.Thread.run(Thread.java:722)

Seen when hot-deploying a war file in tomcat 7.0.47, didn't yet check out the specific place in the code.

Nullpointer Exception when reading CMYK (Servlet)

Based on the latest version of this github repository (running java 1.6.0_16 and Debian 4.1.2-25). I build the project with maven and then added

twelvemonkeys-common-lang-3.0-SNAPSHOT.jar
twelvemonkeys-common-io-3.0-SNAPSHOT.jar
twelvemonkeys-common-image-3.0-SNAPSHOT.jar
twelvemonkeys-imageio-core-3.0-SNAPSHOT.jar
twelvemonkeys-imageio-metadata-3.0-SNAPSHOT.jar
twelvemonkeys-imageio-jpeg-3.0-SNAPSHOT.jar
twelvemonkeys-imageio-tiff-3.0-SNAPSHOT.jar
twelvemonkeys-servlet-3.0-SNAPSHOT.jar

to my servlet libs. I'm trying to read any CMYK image, for example:

Channel digital image CMYK color

From Wikipedia. The same image is loaded if I just run a test locally.
As a servlet, I get the following NullPointerException:

java.lang.NullPointerException
    at com.twelvemonkeys.imageio.color.ColorSpaces.getColorSpace(ColorSpaces.java:265)
    at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.getImageTypes(JPEGImageReader.java:232)
    at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.readImageAsRasterAndReplaceColorProfile(JPEGImageReader.java:351)
    at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:337)
    at javax.imageio.ImageIO.read(ImageIO.java:1422)
    ...

It seems really odd, that this line would cause a NPE, as the code in com.twelvemonkeys.imageio.color.ColorSpaces just reads:

profile = genericCMYK.get();

and the genericCMYK is a static variable:

private static WeakReference<ICC_Profile> genericCMYK = new WeakReference<ICC_Profile>(null);

that does not seem to be nulled anywhere.

Unreadable TIFF image

Hello Harald,

I've tried to load some TIFF but for one I get:

javax.imageio.IIOException: Unsupported TIFF Compression value: 4
at com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReader.read(Unknown Source)

Is that a known limitation or a bug?

Thanks,

Daniele.

Unable to load JPG images due to "Unsupported JPEG process: SOF type 0xcb"

Before starting the bug report - you also save my day :-)

For a few images I get the error message

Unsupported JPEG process: SOF type 0xcb

[ERROR] [2014.03.26 09:53:49]  Loading the image failed  : /iad/styria/prod/htdocs/uploads/20140301_123857_2363439246058001517.jpg [Environment: Host: "www.willhaben.at" Action: "swfuploadimage" Action Class name: "null" Sequence #: "135192664" Referer: "null" URL: "/swfuploadimage" RemoteIP: "212.152.181.235" User-Agent: "Shockwave Flash" jsessionid=3AD5B5AC
CAC4F054C1F1EEA4FE891D51&[email protected]]  at no.finntech.base.modules.scale.ScaleJavaOnly.createImageFromImageFile(ScaleJavaOnly.java:282)
javax.imageio.IIOException: Unsupported JPEG process: SOF type 0xcb
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method)
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1231)
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:1034)
        at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
        at javax.imageio.ImageIO.read(ImageIO.java:1448)
        at javax.imageio.ImageIO.read(ImageIO.java:1308)

Not an expert but

  • it might stem from an unsupported compression type "Lossless (sequential arith)"
  • it might not stem at all from your library

I attached the offending image

Cheers,

Siegfried Goeschl

test-image-broken-01

Using the JPEGImageReader

Hi,
sorry for the stupid question, but I'm currently trying to read some Images that throw the java.awt.color.CMMException in the normal ImageIO.
But I just don't know what to import/use, I build the project via maven and added the imageio.plugins.jpeg jar to my classpath. I read in a Stackowerflow post that I can use it like the normal ImageIO but it doesnt't really work that way.
I hope I haven't overseen some doc files but I didn't find anything expect the readme saying "we did it"
greets

TIFF reading of short and integer rasters unreasonably slow

Reading byte rasters are fast, short and int rasters are (very) slow.

Known reason:
Byte rasters are read using DataInput.readFully(byte[]...).
Short and Integer rasters are currently read in loop, reading one short/int at a time, respectively.

QuickFIx:
Cast to ImageInputStream if possible, and use the overloaded readFully that takes short[]/int[] parameters.

Full fix:
Implement util functions that can read short/int arrays fast from a DataInput, probably using ByteBuffer or similar code to the one in ImageInputStream.

Improvement: Move CompoundDirectory from imageio-tiff to imageio-metadata

Hi all,
First time working with TwelveMonkeys (a non-sun ImageIO impl, awesome!).

I'm working only on Metadata extraction, and I found that compounddirectory was only in the imageio-tiff jar -- would it be possible to move that to imageio-metadata?

usecase: When working with only the metadata of the images, to be able to use only the imageio-metadata jar package (and core) without needing all the image manipulation support that is in the image-specific libraries.

I'm raising this as an issue in case there are other considerations, as this is only at first-blush it seems like a reasonable idea.

Does not build on windows (minor fix in tests)

Did not commit due to time constraints:
In com.twelvemonkeys.util.convert.DefaultConverterTestCase replace line 50:
from (unix specific):
new Conversion("/temp, /usr/local/bin", new File[] {new File("/temp"), new File("/usr/local/bin")}),
to (OS agnostic):
new Conversion("/temp, /usr/local/bin".replace('/',File.separatorChar), new File[] {new File("/temp"), new File("/usr/local/bin")}),

Thanks for a great library!

package build fails becouse of imageio-iff test failure

Hello there,

I'm trying to build the 3.0-SNAPSHOT using just "mvn" package but the packaging fails becouse of tests.

Here the stack trace:

testEHBColors(com.twelvemonkeys.imageio.plugins.iff.IFFImageReaderTest) Time elapsed: 0.076 sec <<< FAILURE!
java.lang.AssertionError: expected:<13> but was:<0>
at org.junit.Assert.fail(Assert.java:91)
at org.junit.Assert.failNotEquals(Assert.java:645)
at org.junit.Assert.assertEquals(Assert.java:126)
at org.junit.Assert.assertEquals(Assert.java:470)
at org.junit.Assert.assertEquals(Assert.java:454)
at com.twelvemonkeys.imageio.plugins.iff.IFFImageReaderTest.testEHBColors(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

Is some native library missing?

Thanks,

Daniele.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.