Loading large JPEGs usinga JAI

I am loading images using JAI. I first load the image into a RenderedOp class and I then get the bounds of that RenderedOp before I put it into the DB. I am monitoring the tile caching using the TCTool. I am able to load large TIFF files (128 MB) no problem. However, when I try to load a large(ish) JPEG fi[le (25MB) I get a "Occurs in: javax.media.jai.ThreadSafeOperationRegistry
java.lang.reflect.InvocationTargetException: java.lang.OutOfMemoryError" error or a "java.lang.RuntimeException: Waiting thread received a null tile." if the TCTool (tile cache monitoring tool) is turned on. This error occurs when I attempt to get the bounds of the RenderedOp object. Is there a known bug with loading JPEG images using JAI? Small JPEG images load no problem. Is this a problem with the tile cache and does anyone know how I get around it?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

How does getting the bounds of the image help? Well I can get it to render large tiff files easily (80mb). But I can't get it to render out 20mb jpeg. I haven't tried tiling the image yet, but I'm working on that code as we speek. That's the only thing I can think of that would render tiff's and not jpeg's.
The size of the jpegs are about 3072p x 2048p. Any ideas?
Thanks for your input.

Similar Messages

  • Need some help trying to generate thumbnail images from large Jpegs

    Hello,
    I have some ActionScript 3.0 code, created with Flex that
    will load a large JPEG image (say 3000x2000 pixels) that I'm trying
    to create a 100 pixel thumbnail. I have the code working where I
    generate the thumbnail, but it's not maintaining the aspect ratio
    of the original image. It's making it square, filling in white for
    the part that doesn't fit.
    I've tried just setting the height or width of the new
    image, but that doesnt render well, either.
    To see what I'm talking about, I made a screen shot, showing
    the before image, and the rendered as thumbnail image:
    http://www.flickr.com/photos/taude/533544558/.
    Now, there's a few things important to note. I'm saving the
    thumbnail off as a JPEG. As you can see in my sample application,
    the original renders fine with the proper aspect ratio, it's when
    I'm copying the bytes off the bitmapdata object, where I need to
    specify a width and height, that the trouble starts. I've also
    tried using .contentHeight and .contentWidth and some division to
    manually specify a new bitmapdatasize, but these values seem to
    always have NaN.
    private function makeThumbnail():void{
    // create a thumbnail of 100x100 pixels of a large file
    // What I want to create is a a thumbnail with the longest
    size of the aspect
    // ratio to be 100 pixels.
    var img:Image = new Image();
    //Add this event listener because we cant copy the
    BitmapData from an
    /// image until it is loaded.
    img.addEventListener(FlexEvent.UPDATE_COMPLETE,
    imageLoaded);
    img.width=100;
    img.height=100;
    img.scaleContent=true;
    img.visible = true;
    // This is the image we want to make a thumbnail of.
    img.load("file:///C:/T5.jpg");
    img.id = "testImage";
    this.addChildAt(img, 0);
    private function imageLoaded(event:Event):void
    // Grab the bitmap image from the Input Image and
    var bmd:BitmapData =
    getBitmapDataFromUIComponent(UIComponent(event.target));
    //Render the new thumbnail in the UI to see what it looks
    theImage.source = new Bitmap(bmd); //new Bitmap(bmd);
    public static function
    getBitmapDataFromUIComponent(component:UIComponent):BitmapData
    var bmd:BitmapData = new
    BitmapData(component.width,component.height );
    bmd.draw(component);
    return bmd;

    Dev is 10gR2 and Prod is earlier version of Oracle, 10gR1.
    The schema (or table(s)) export file created by Oracle Database Control in Oracle 10gR2 is not importable into 10gR1, by default.
    Workaround.
    Use the Schema (table(s) export wizard of in the Maintenance section
    of the Oracle Database Control in ver 10R2,
    but when you get to the end of the wizard (I recall Step 5),
    show the data pump export source PL/SQL code, cut and past to editor,
    and find the variable where you can set the Oracle database version
    to your prod database version,
    then run the script from the SQL Plus prompt in 10gR2 dev,
    and this creates an Oracle 10gR1 compatible data export file.
    Then go to Prod and run the schema (table(s)) import data wizard,
    and import the export file. You will have to option to move the data
    to another schema or tablespace if required.
    Just to not run into troubles, I use the same schema and tablespace name
    in both dev and prod.
    the variable you must modify in the 10gR2 datapump export script looks like
    h1 := dbms_datapump.open (operation => 'EXPORT', job_mode => 'SCHEMA', job_name => 'ExportTableToProdJob', version => 'COMPATIBLE');
    and you must change manually to
    h1 := dbms_datapump.open (operation => 'EXPORT', job_mode => 'SCHEMA', job_name => 'ExportTableToProdJob', version => '10.1.0.1');
    This creates a 10g1.0.1 or later compatible export data file.
    You must have read/write privileges to the folder were the export data file will be created, and imported from. (Oracle Directory Object)

  • OUT OF MEMORY - during loading images (JPEG's)

    Hallo,
    We use the OHJ (version 4.1.12) inside a Java/Swing application with JDK 1.3.1.
    Our online help contains a lot of larger JPEG images. When the user navigates through the online help - an out of memory occurs while loading the images.
    I tried to split the help pages in a lot of small HTML pages, but this doesn't help. It seems that the OHJ does not clear the memory
    when loading the next HTML page.
    Can the OHJ deal with larger images ?
    Any other possibilities ?
    Thanks
    Markus Pohle

    >
    It seems that the OHJ does not clear the memory when loading the next HTML page.
    Can the OHJ deal with larger images ?
    We have never seen such a problem with large images and OHJ. Could you send us a ZIP containing your help content by e-mail to [email protected] so that we can try to reproduce it?
    Thanks,
    -brian

  • Loading large images

    Hi there,
    I'm facing lot of problem while loading large image (25+ MB JPG/TIFF) in editor pane using ImageIO. I always get OuofMemory exception or my machine (p4 2.4ghz/512 ddr) get hangs. Is there any way to load large images within a moment in Java? I have seen one s/w (written in vc++) that do the same. I'm trying to replicate that s/w.
    Is there any 3rd party Java API to do the same? Have you guys develop similar s/w before?
    I've tried many ways: by changing heap size, using ImageMagick, spliting the image, etc. but never get satisfactory results.
    Any help would be appreciated.
    Thanks in advance.
    -tamal

    You can use Java Advanced Image
    http://java.sun.com/products/java-media/jai/downloads/download-1_1_2.html
    this will avoid the out of memory error.
    I use it to read and show 20K*20K pixel images.
    the loading is immadiate.
    If you use javax.media.jai.widget.ScrollingImagePanel (deprecated) class to visulize the image is quite quick.
    Obviouse that if you want to visualize the entire image you will need to wait an approprite time for rescaling it.

  • How to read local large JPEG files and display into Images Tile

    Hi all,
    I can read the local multiple files by FLEX/AIR FileListEvent
    and loader to read the large JPEG files but cannot display them
    into a TileList. Since it is a number of images files, how can I
    put them into a thumbnail TileList.
    Please kindly advise.
    Regards,
    Billy

    1. So I would like to know which is the {color:#3366ff}best way to load local images in ImageView{color}.I'm no expert, but is there a reason that you are using Swing to do the loading?
    2. secondly, currently the system displays all images only after the completion of creating all images. {color:#3366ff}How to display images as and when they are created.{color} So that the user has a feeling that the images are loading.JavaFX Image class let you display a lightweight placeholder, and you can bind the progress to some kind of visual indicator. I don't think you can display an image that is partially loaded.
    def PATHS: String[] = [
        "C://Ariel Atom//ariel-atom-1.jpg",
        "C://Ariel Atom//ariel-atom-2.jpg",
        "C://Ariel Atom//ariel-atom-3.jpg",
        "C://Ariel Atom//ariel-atom-5.jpg"
    function getImage(path: String): Image {
        Image {
            url: "file:///{path}"
            backgroundLoading: true
    Stage {
        title: "Image Tiles"
        width: 1024
        height: 800
        scene: Scene {
            content: [
                Tile {
                    columns: 2
                    tileWidth: 400
                    tileHeight: 400
                    content: for (i in [0..3]) {
                        ImageView {
                            image: getImage(PATHS)

  • Loading large files in Java Swing GUI

    Hello Everyone!
    I am trying to load large files(more then 70 MB of xml text) in a Java Swing GUI. I tried several approaches,
    1)Byte based loading whith a loop similar to
    pane.setText("");
                 InputStream file_reader = new BufferedInputStream(new FileInputStream
                           (file));
                 int BUFFER_SIZE = 4096;
                 byte[] buffer = new byte[BUFFER_SIZE];
                 int bytesRead;
                 String line;
                 while ((bytesRead = file_reader.read(buffer, 0, BUFFER_SIZE)) != -1)
                      line = new String(buffer, 0, bytesRead);
                      pane.append(line);
                 }But this is gives me unacceptable response times for large files and runs out of Java Heap memory.
    2) I read in several places that I could load only small chunks of the file at a time and when the user scrolls upwards or downwards the next/previous chunk is loaded , to achieve this I am guessing extensive manipulation for the ScrollBar in the JScrollPane will be needed or adding an external JScrollBar perhaps? Can anyone provide sample code for that approach? (Putting in mind that I am writting code for an editor so I will be needing to interact via clicks and mouse wheel roatation and keyboard buttons and so on...)
    If anyone can help me, post sample code or point me to useful links that deal with this issue or with writting code for editors in general I would be very grateful.
    Thank you in advance.

    Hi,
    I'm replying to your question from another thread.
    To handle large files I used the new IO libary. I'm trying to remember off the top of my head but the classes involved were the RandomAccessFile, FileChannel and MappedByteBuffer. The MappedByteBuffer was the best way for me to read and write to the file.
    When opening the file I had to scan through the contents of the file using a swing worker thread and progress monitor. Whilst doing this I indexed the file into managable chunks. I also created a cache to further optimise file access.
    In all it worked really well and I was suprised by the performance of the new IO libraries. I remember loading 1GB files and whilst having to wait a few seconds to perform the indexing you wouldn't know that the data for the JList was being retrieved from a file whilst the application was running.
    Good Luck,
    Martin.

  • Slow render times with large jpegs - complete system lag

    In a project i'm working on I have two large jpegs with a small zoom scaling effect. Going from 100 to 103 percent.
    I've noticed that both Adobe Media Encoder and Premiere Pro experience a heavy slow down in render time as soon as the jpegs have to be rendered.
    Not only does the render speed almost come to a halt, the complete system lags very heavy, even the mouse cursor won't respond well.
    This happens when i have GPU acceleration enabled and when i do a 2 pass H264 encoding.
    When I have the GPU acceleration disabled the render goes very smooth, and doesn't seem to slow down...
    The jpeg is 4023  x 2677, and 6,97 MB large.
    Scaling the jpeg down to about 1920x1080 in Photoshop and put that one in the timeline made the render go a lot faster.
    I understand that a large picture takes a bit more time to be rendered, but we're talking about a 10minute render whit the large jpeg file and  a 2 minute render with the jpeg resized.
    The total time of the two jpegs in the video is 5 seconds in a 3 minutes video.
    So, that made me think that the render times are exponentially long.
    In the timeline everything runs really smooth.
    Is this considered normal, I can't remember having such big differences in CS5. It's not a major thing, but I wanted to share anyway.
    My system:
    Premiere Pro CC (latest)
    i7 4930K
    32 GB RAM
    2xGTX480
    Footage and project on a Raid0 disk
    Previews/Cache on a Raid0 disk
    System and Premiere on SSD
    Render to a single 7200 rpm drive.

    >wanted to share
    Yes... known issue... I think some of the below is about P-Elements, but the same ideas
    Photo Scaling for Video http://forums.adobe.com/thread/450798
    -HiRes Pictures to DVD http://forums.adobe.com/thread/1187937?tstart=0
    -PPro Crash http://forums.adobe.com/thread/879967

  • Flash Builder 4.5 Hangs When Loading Large Projects

    I recently upgraded from Flash Builder 4.0 to Flash builder 4.5.  I am running the 32 bit version of Eclipse Helios on windows 7, 64 bit.  I have installed the latest 32 bit Java build, jdk1.6.0_25
    Smaller projects and libraries appear to build and run fine.  However when I attempt to load my main application, which is quite large, Eclipse Hangs for several minutes.  Occasionally it will return after some time, but as soon as I move the mouse cursor again it hangs again.  The last attempt had 1.8 Gigs of memory allocated to the eclipse process before I killed it.
    Some other things I have noticed.
    *) 4.5 does appear to be more sluggish for me generally than 4.0 for the demo apps I have built to test weather or not the install is working
    *) If I do not attempt to actually open any files, I am able to clean the project and have it produce an executable
    *) I have "build automatically" turned off, the problem does not seem to be initiated by the build. The problem seems to be something to do with loading large mxml files or files which include large mxml files.
    *) The log files only complain about Eclipse being closed improperly (from me killing it aftter a prolonged hang) and about a collision with the ctrl+shift+G key combination
    *) I have reverted to the original 4.0 plugin and the project still builds fine
    *) Opening the stand alone flash builder 4.5 and pointing it at the same projects that work in 4.0 yields the same hanging symptoms as the 4.5 plugin version
    *) I have juiced up my Eclipse memory settings and confirmed that they work quite well for my 4.0 build.  My Eclipse.ini looks like:
    -showsplash
    org.eclipse.platform
    --launcher.XXMaxPermSize
    256m
    -startup
    plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
    -product
    org.eclipse.epp.package.java.product
    --launcher.defaultAction
    openFile
    --launcher.defaultAction
    openFile
    -vm
    c:/Program Files (x86)/Java/jdk1.6.0_25/bin/javaw.exe
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -Xms1024m
    -Xmx1024m
    -XX:PermSize=256m
    -XX:MaxPermSize=256m
    I am really interested in several of of the new 4.5 features.  Any comments / suggestions welcome.  I am out of ways I know how to trouble shoot this short of rebuilding my app up from scratch by adding components one at a time, which would take a very long time.
    If it would be at all helpful, I would be happy to drop by the San Francisco office with my laptop to trouble-shoot this
    -Chris.

    When I run the application in the memory profiler under FB 4.0 it takes
    about 80MB of RAM peak.
    I can not get the app to launch out of FB 4.5.
    I have reproduced this issue on two different machines running only Eclipse
    both stand alone and the plugin versions.
    My machine has 4GB of RAM, my typical usage is less than 2GB.
    Right now with FB 4.0 I am working on the problem project and a few sample
    projects and Eclipse is consuming about 600MB which seems normal to me.
    The confusing thing for me is that everything works fine and is responsive
    with FB 4.0 and the issue does not seem to be actually compiling the
    application, rather it has something to do with how FB is parsing my source
    code that causes the hang.  Almost like somehow a circular dependency check
    that used to work is now failing or something like that.
    I am not sure how to find out what FB 4.5 is hanging on precisely.  I can only
    see that the logs look normal and memory usage climbs out of sight while it
    is hanging.
    -Chris

  • Errors on open large jpeg files in Windows 2000

    Q. I am having problems opening large jpeg files (eg 40"x30" @270 ppi)
    after having saved them in Windows 2000
    A. This is a known issue and can be resolved either by turning off
    thumbnails for JPEGS or by using the JPEG2000 file format. The
    Photoshop plugin for Windows can be obtained from Adobe:-
    http://www.adobe.com/products/photoshop/cameraraw.html
    Carol
    (Posted from the UK)

    This is from the post at this site: Re: Adobe CS6 file associations are all messed up
    Just change the directory to the correct EXE for cc 2014 and you should be good.
    Correct Answerby Curt Y on Jun 5, 2012 7:08 PM
    Here is a registy fix for Win7 machines to the file association problem.
    This from TinusHDCA user:
    I installed Photoshop CS6, then found CS5 was still there. I thought, hey, I don't need CS5 anymore, so I uninstalled CS5. then I found out that Photoshop was no longer available in 'Open with' when right-clicking an image...
    So I went into the Registry, HKEY_CLASSES_ROOT\Applications\Photoshop.exe\shell\open\command, and changed the (Default) from "C:\Program Files\Adobe\Adobe Photoshop CS5 (64 Bit)\Photoshop.exe" "%1" to "C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Photoshop.exe" "%1" (so changed CS5 to CS6) - and now I see 'Adobe Photoshop CS6' in my 'Open with' list when right-clicking an image...

  • Does anybody know how Oracle load large N-Triple file into Oracle 11g R1?

    Does anybody know how Oracle load large N-Triple(NT) file into Oracle 11g R1 by using sql*loader according to their benchmark results?
    Their benchmark results indicate they have over come the large data set problem.
    http://www.oracle.com/technology/tech/semantic_technologies/htdocs/performance.html
    It means they have loaded LUBM 8000(1.068 Billion+ Triples) into Oracle successfully, but there is no detailed steps provided. For instance, 32-bit or 64-bit platform they used, only one NT file being used corresponding to one dataset or several NT files?
    Is there any exception occured during the loading process if the NT file beyond 60GB? When using jena to generate NT file against LUBM(8000), the size of the NT file would definitely beyond 60GB.
    We are dividing such large NT file into several small ones? Is it a good approach? I'm hesitating to do so!

    A Linux 32-bit platform was used for bulk-load of LUBM-8000 1.106 billion (before duplicate elimination) RDF triples into Oracle.
    Multiple gzipped N-Triple files were used to hold the LUBM-8000 data. zcat was used on all these files together to send the complete data into a named pipe. SQL*Loader used this named pipe as the input data file to load the data into a staging table in Oracle. Once the staging table was loaded, the sem_apis.bulk_load_from_staging_table API was used to load the data into Oracle Semantic Store.
    (Additional details in http://www.oracle.com/technology/tech/semantic_technologies/htdocs/performance.html )
    Thanks.

  • AS3 parent loading in AS2 child that in turn loads in jpegs *Problem*

    Hiya everybody.
    I'm getting a bald patch on my head from frustration with the following problem.
    I have a parent AS3 swf which loads in a AS2 swf like so;
    stop();
    var ldr:Loader = new Loader();
    ldr.load(new URLRequest( "as2child.swf"));
    addChild(ldr);
    contained in the AS2 file is the following script which loads in jpegs when the user clicks the next button, etc.
    //stuff that loads in different photos
    stop();
    var i:Number = 1;
    //load first image straight away.
    function initialloadup () {
    i = 1;
    startLoading("pic"+i+".jpg");
    initialloadup();
    next_btn.onRelease = function () {
    /*on clicking next image button load next image in sequence*/
    i++;
    if (i > 11 ) {i = 1};
    startLoading("pic"+i+".jpg");
    trace("pic"+i+".jpg");
    prev_btn.onRelease = function () {
    //on clicking previous image button load prev image in sequence
    i--;
    if (i < 1 ) {i = 11};
    startLoading("pic"+i+".jpg");
    function startLoading(whichImage) {
    loadMovie(whichImage, "imageLoader");
    however when you view the AS2 swf via the AS3 swf it does not seem to load in the jpgs when requested.
    I need to retain the AS2 file so cannot rewrite in AS3 as the image loading thing is only a small part of the AS2 file.
    Any ideas? might it be to do with how the AS2 is read in AS3?
    Cheers for your reading this
    Melacroso

    Hi Ned,
    Cheers for your thoughts. I've heard of the lockroot thingymajig. Tried it out but to no avail.
    I've attached a zip file containing the fla's and swf's and jpgs, just incase anyone yourself included might have anymore ideas.
    Thanks for your time
    Alec

  • When using  Vikas' program to load large files  getting error

    Hello,
    I am using Vikas' program to load large data files: http://htmldb.oracle.com/pls/otn/f?p=38131:1
    This works fine, except when I click on the button to create table, then I get a "not found" error--
    failed to parse SQL query:
    ORA-00942: table or view does not exist
    What might cause this? I've checked grants and such and reviewed the code, but haven't figured it out...
    Thanks!

    Hello,
    I am using Vikas' program to load large data files: http://htmldb.oracle.com/pls/otn/f?p=38131:1
    This works fine, except when I click on the button to create table, then I get a "not found" error--
    failed to parse SQL query:
    ORA-00942: table or view does not exist
    What might cause this? I've checked grants and such and reviewed the code, but haven't figured it out...
    Thanks!

  • Tips for importing large JPEGs into PE

    The short version of my question is that I am looking for the most efficient way to import a large number of very large JPEG still photos (with various pixel dimensions) into a Premiere Elements project with the best resulting image quality possible.  I have been frustrated so far with the resulting image quality.
    Here’s some more detail.  I am brand new to PE.  I’m using PE 11 on Windows Vista.  I had been putting up with Windows Movie Maker for many years, but finally threw in the towel due to its ungraceful handling of AVCHD video.  I want to combine still photos with my home movie video in my projects and create DVDs for playback on an NTSC widescreen HDTV.
    My JPEG still photos come from several different cameras, and I do a lot of cropping.  So the pixel dimensions vary quite a bit.  The uncropped pixel size from my DSLR is 4000x6000, so they are too big to import into PE.  I read that a good approach was to create a slide show in Organizer and import this into PE.  I used Organizer to create a WMV video slideshow with the highest quality settings.  The WMV video doesn’t look too bad when I play it back on my PC.  But I notice a significant degradation in image quality when I preview the WMV file in PE (compared to playing the file on my PC).  The resulting quality of a published DVD is even worse (played on either TV/DVD or PC).  PE selected HD 1080i, 1920x1080 for my project.
    I know PE is not designed for still photo slideshows.  I’m not expecting the same quality as the original JPEGs, but I think I can do better than what I am seeing so far.  Any suggestions, tips, or links to reference articles would be greatly appreciated.  I’ve also read about resizing the stills in Photoshop (I have Elements 11) and then importing into PE.  I haven’t tried this yet, but this sounds like a lot of work (even with batch processing) due to all the different pixel dimensions I have with my photos.

    A few weeks ago this same subect was being discussed.  Taking Bill Hunt's and other's advice, I spent the larger part of a day trying it out.  As near as I can tell, I followed Bill's advice carefully.  I put together a demo video and posted it on Vimeo where viewers can download the original PrE11 output for examination.   As I recall it was a long thread and by the time I posted the video interest was dying. 
    Here it is again:  https://vimeo.com/60952115
    It is only my personal experience, but resizing provided no advantage or disadvantage.
    As another test I made a short video of about a half dozen random RAW photos and posted to Vimeo.  I used no resizing and, to my eye, results are fine.   Watch or download here:  https://vimeo.com/60904593
    Maybe the Adobe engineers have quietly put something into Premier Elements to resize, or somehow process, photos.  I do know that when it was time to upgrade to ACR 7.2, and later 7.3, for Photoshop Elements, the automatic Adobe downloader/installer reported it updated ACR in Premier Elements.  ACR does not process videos.  It is for photos and is in PrE11.
    Bill S

  • Problem loading large DNG images with Camera RAW!

    Hello,
    When loading large DNGs with Camera RAW 4.4 (for example, DNG dimensions are 9984x6656) CS3 says "cannot open the image because this is not a right kind of a document". EXACTLY THE SAME file is loaded without a problem using Camera RAW 3.7 and 4.0 (did not test other versions). Have you specially prevented loading of large files? Wouldn't it be better to provide this as an option? It's a real disappointment - new version of plugin CANNOT do the thing that older versions CAN. (Simply using older version is not an option, as I need to load RAWs from new cameras, like Canon 450D).
    Dear Adobe, please correct this problem :)

    It might be wise to give some insight like how the DNG was created, by what version of what software, if ACR is hosted in Photoshop or Bridge... What platform you are using, how much RAM, memory allocation, etc.

  • Getting DPI of a JPEG with JAI

    I need to get width / height in cm or inches and the DPI of a JPEG using JAI.
    I'm currently getting the width and height in pixels using getWidth() and getHeight() of a RenderOp, but it apparently hasn't similar methods to get the DPI (which will suffice).
    I'm still seeking into all of the JAI classes, but i'm kind of lost within it.

    The reason why i want to try to do it with JAI is the following.
    We have a huge collection of JPEG images, that our customer creates daily.
    To retrieve image size and resolution, i initially had used a public domain class, whose source is identified by this header:
    * ImageInfo.java
    * Version 1.5
    * A Java class to determine image width, height and color depth for
    * a number of image file formats.
    * Written by Marco Schmidt
    * <http://www.geocities.com/marcoschmidt.geo/contact.html>.
    * Contributed to the Public Domain.
    * Last modification 2004-02-29
    */It worked fine, but we discovered that it fails with JPEG our customer created before a certain date.
    Then i tried with javax.imageio.ImageIO, like this:
    Iterator readers = ImageIO.getImageReadersByFormatName("jpeg");
    ImageReader reader = (ImageReader)readers.next();
    FileInputStream source = new FileInputStream("my.jpeg");
    ImageInputStream iis = ImageIO.createImageInputStream(source);
    reader.setInput(iis, true);
    IIOMetadata meta = reader.getImageMetadata(0);
    IIOMetadataNode nodes = (IIOMetadataNode) meta.getAsTree("javax_imageio_1.0");
    NodeList nl = nodes.getElementsByTagName("HorizontalPixelSize");
    if ((nl != null) && (nl.getLength() > 0))
        xDPI = Math.round(25.4f / Float.parseFloat(nl.item(0).getAttributes().item(0).getNodeValue()));
    nl = nodes.getElementsByTagName("VerticalPixelSize");
    if ((nl != null) && (nl.getLength() > 0))
        yDPI = Math.round(25.4f / Float.parseFloat(nl.item(0).getAttributes().item(0).getNodeValue()));Same identical problem. The new JPEGs work, the old ones don't.
    In this case, javax.imageio.ImageIO throws an exception saying:
    javax.imageio.IIOException: Not a JPEG file: starts with 0x55 0x72Quite explicit. The problem is that these JPEGs are correctly rendered, without a bit of complaining, by all the browsers, by all the imaging programs we tried (Adobe Photoshop, Adobe ImageReady, Paint, whatever) and also by the preview feature of Windows Explorer. We never found a single application which complains about these JPEGs. Also the size and resolution are correctly retrieved by these imaging programs.
    If javax.imageio.ImageIO says it's a bad JPEG, it's a bad JPEG; however i'd need to make the whole thing work because of the above reason. That's why i'd like to try with JAI too.

Maybe you are looking for

  • Maverick keeps crashing on my macbook pro.

    Hi, I upgraded the OS on my macbook pro back in December to Mavericks.  I needed to update the firmware on a unit I was installing and it required Windows, thus needed to bootcamp.  The crashing started there after and has progressed until now it cra

  • IPod not charging or being recognized by PC

    Everything worked fine until I plugged in my iPod to add new music through iTunes. iTunes was saying it was encountering an issue and had to close. So I closed it and unplugged the iPod. Now the iPod won't come on. The apple screen comes on and then

  • Supply Chain Performance

    Dear Team, I'm looking for a seeded report that captures the following supply chain flow: Start -> Requester Order -> Approval -> Quote -> PO -> Items Receive -> Delivery to Requester -> Requester item receiving -> End Appreciate any response whether

  • Replecement Path Variable

    Hello, I would insert others value for a Replacement Path variable ( taken for another query ). How can I do ? example: a variable

  • Line tool marks are appearing on every page

    I received a mortgage disclosure statement that I have to sign. There is no security on the document. When I use the Line Tool to check off some of the boxes though, the lines appear on EVERY page of the document. I only need it on ONE page. I checke