Same image, same code, different results!!

Hi,
I have this HUGE dilema, the following works with a gif or a jpg image but the problem occurs in png images (the format I have chosen to create my images in).
Here is the source code for the applet:
* bufferstr.java
* Created on 23 October 2003, 14:03
* @author  Ahmed
package Destruction_BufferStrategy;
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import javax.swing.*;
public class appletExecutor extends JApplet {
    private Image offs;
    private Graphics2D g2;
    ImageLoader imageStore;
    Game game;
    public void init() {
        imageStore = new AppletImageLoader();
        imageStore.prepareImage("car2dirty1.PNG");
        imageStore.prepareImage("car2dirty2.PNG");
        imageStore.prepareImage("car2dirty3.PNG");
        imageStore.prepareImage("car2dirty4.PNG");
        imageStore.prepareImage("car2dirty5.PNG");
        game = new Game(imageStore, this.getSize().width, this.getSize().height);
        super.getContentPane().add(game);
        game.startThread();
        game.createStrategy();
        game.requestFocus();
}and here is the code for the application:
* appExecutor.java
* Created on 25 October 2003, 01:08
package Destruction_BufferStrategy;
* @author  Ahmed
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import javax.swing.*;
public class appExecutor extends JFrame {
    private Image offs;
    private Graphics2D g2;
    ImageLoader imageStore;
    Game game;
    public appExecutor() {
        super("Destruction Derby");
        setDefaultCloseOperation(super.EXIT_ON_CLOSE);
        setResizable(false);
        setBounds(0, 0, 600, 600);
        imageStore = new AppletImageLoader();
        imageStore.prepareImage("car2dirty1.PNG");
        imageStore.prepareImage("car2dirty2.PNG");
        imageStore.prepareImage("car2dirty3.PNG");
        imageStore.prepareImage("car2dirty4.PNG");
        imageStore.prepareImage("car2dirty5.PNG");
        game = new Game(imageStore, 600, 600);
        getContentPane().add(game);
        show();
        game.startThread();
        game.createStrategy();
    public static void main(String[] args) {
        new appExecutor();
}if I use a jpg or a gif image, everything is as good as gold. However, when I use png images, this error occurs in the applet only:
java.util.zip.ZipException: invalid stored block lengths
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:140)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
at java.io.FilterInputStream.read(FilterInputStream.java:66)
at com.sun.imageio.plugins.png.PNGImageReader.decodePass(PNGImageReader.java:1165)
at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(PNGImageReader.java:1276)
at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1362)
at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1530)
at javax.imageio.ImageIO.read(ImageIO.java:1384)
at javax.imageio.ImageIO.read(ImageIO.java:1348)
at Destruction_BufferStrategy.AppletImageLoader.loadImage(AppletImageLoader.java:36)
at Destruction_BufferStrategy.AppletImageLoader.prepareImage(AppletImageLoader.java:45)
at Destruction_BufferStrategy.appletExecutor.init(appletExecutor.java:28)
at sun.applet.AppletPanel.run(AppletPanel.java:347)
at java.lang.Thread.run(Thread.java:536)
Error Loading Image: car2dirty1.png
the Error Loading Image: car2dirty1.png is from my Loading Images class which abuse so kindly showed me the light to.
any help on this issue is of great appreciatence..
P.S. the error occurs for every image, not just this one!!

You don't actually show the method you are using to load your image, however from the error msg, I assume you are using ImageIO.read().
What version of JRE are you using?
The reason I ask, is because the error you are getting seems to be occuring at quite low-level; the only potencial cause I know of (outside an error of your creation) is the ImageIO loader in 1.4.0 is buggy/broken when dealing with small images.

Similar Messages

  • Same Effects Panel parameters-different results on Tiff & Psd file format?

    Just a quick question to all the users and the Adobe Lightroom team & see if anybody has the same problem.
    I have one file saved in a Tiff format & the exact duplicate saved in a PSD, however when I sync the Effects Panel settings between the two, I get different results. The difference isn't black & white but clearly visible. The grain in the PSD file is less coarse & pronounced and the post crop vignetting is much more subtle. The color balance is also different. In other words every adjustments seems to be more subtle & less pronounced on a PSD file compare to a Tiff file.
    Not the end of the world but clearly something to keep in mind when syncing settings between the two formats and something that shouldn't be there in the first place.
    Thanks

    Now you are providing more detail.
    "... but lesser quality at least in terms of natural movement."
    It sounds very much like 11 is exporting 25p/30p which is why you see non smooth motion.
    25p/30p is the result of deinterlacing 50i/60i. When you take two FIELDS that are 1/50th or 1/60th apart and create 1 image, these images will be 1/25th or 1/30th second apart.
    You can create 1 frame through several methods.
    With iM09 deinterlacing occured only if you imported as LARGE, OPTIMIZED video, or used a function or FX that scales video. Perhaps with 11, Apple has decided that its time to FORCE any kind of interlaced video to be deinterlaced.
    In other words, LARGE and FULL only relate to size.
    One possible advantage is that Apple has finally decided to deinterlace using BLEND during import. This would look better, but it creates 25p or 30p video.
    They may hinting its time to buy a progressive camera.

  • Same calculation producing two differing results

    Hi All
    I have some code in a user exit on save of a delivery (VL02N) that calculates the number of bags/pallets required to furnish that delivery.
    I am now adding the same code to a user exit on save a sales order (VA02) to calculate the number of bags/pallets again but when run it is producing differing results.
    the code is as follows:
    DATA: bag_weight(12) TYPE p DECIMALS 4.
    DATA: pallet_weight TYPE marm-umrez.
    DATA: bag_denominator TYPE i.
    bag_weight = pallet_weight / bag_denominator.
    Assuming pallet_weight = 1000 and bag_denominator = 40.
    On save of a delivery it is calculating bag_weight as 25.0000 (correct):
    On save of a sales order it is calculating bag_weight as 0.0025 (incoorect).
    All data declaration, code etc is the same. Does anybody have any clue as to why it would give two differing answers, I would not like to have to add a additional multiplication step to correct the result otherwise.
    Thanks in advance
    David

    Hi,
    Whenever you are using the Packed numbers, you need to check or set the program attribute fixed point arithmetic only as only this ensure that the decimal point is calculated correctly.
    Have a look at the help.sap.com documentation link:
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm
    Hope this helps.
    Thanks,
    Samantak.

  • Same Sales Organization code - different company code

    Is it possible to have the same sales organization code in 2 different company codes on the physical same server.
    Example:
    Server 200 and Server 210
    I will create company code 112 and company code 113.
    I will create sales org 10 on 112 and sales org 10 on 113.
    Is that possible to have the same sales org code?

    My fault you misunderstood me because my statement is misleading.
    What I mean is this:
    100 company code with 10 (Sales org for Colorado)
    200 company code with 10 (Sales org for Michigan)
    Both have sales org 10 but two different entity. These are all on the same PROD server.
    I hope my explanation now is more clear.
    thanks.

  • Interactive Reporting Reports - Same Rpt Format, but Different Result Set

    I have created a report using result set 1. I've saved that, but want to copy it & use the same format/columns to create a new report using a different result set (the result sets have the same data, but one is filtered). Is there an easy way to change the name of the result set being used w/o re-creating the entire report columns & all?
    Terri

    I am in the Dashboard Studio - Optimize Utility. When I select that report (or any of the others), the Reparent button is grayed out on the toolbar. I've also tried right-clicking on the report and it's grayed out there as well. Any ideas?

  • Same circuit twice with different results

    I've been having some trouble having Multisim match a circuit I have modeled in MATLAB. During the troubleshooting process I put voltage probes on each wire used. The circuit portion in question involves an AC Voltage source connected to a resistor which is then connected to an inductor. I made a copy of the circuit and started from scratch. One of the circuits gives a voltage drop across the resistor, while the other one doesn't drop any voltage at all. I've checked all of the connections and they are all good. The only difference I can see is that one has the pins labeled 1 - 2 while the other is 2 - 1. Does anyone know what the problem is here? I shouldn't not be getting two different results for the same circuit.

    Hi Jmerc,
    Maybe you can post the circuits so that we can compare.
    Tien P.
    National Instruments

  • Same sql statement two different results?

    Hi,
    I was wondering if anyone knows why I am getting different
    results on the same query.
    Basically... when I run this query in "view" in sql server, I
    get the results I need, however when I run in Coldfusion, I am
    getting totally different results.... It is a totally different
    result...
    the query:
    SELECT DISTINCT
    tbl_employees.indexid, tbl_employees.[Employee ID] as
    employeeid, tbl_employees.[First Name] as firstname,
    tbl_employees.[Last Name] as lastname,
    tbl_employees.[Supervisor ID] as supervisorid,
    tbl_workaddress_userdata.firstname,
    tbl_workaddress_userdata.lastname,
    tbl_workaddress_userdata.supervisorid,
    tbl_workaddress_userdata.location,
    tbl_workaddress_userdata.employeeid,
    tbl_workaddress_userdata.locationdescription
    FROM tbl_employees FULL OUTER JOIN
    tbl_workaddress_userdata ON tbl_employees.[Employee ID] =
    tbl_workaddress_userdata.employeeid
    WHERE (tbl_employees.[Supervisor ID] = 7) AND
    (tbl_workaddress_userdata.location IS NULL)

    I suspect you and your CF DSN are looking at two different
    DBs...
    Adam

  • Dual Screen / Render differ for the same image (same time!) - Full size

    On my Mac Pro / lightroom 2.3, I have 2 screens connected (same brand: Dell, Same size 24'). One is in landscape position, the other is vertical.
    I use the landscape one as Screen 1.
    If I display an image (1:1 ratio) on the Screen 2, the rendering is not sharp (seem to not be finished / close to be!), the same image render on screen one is correct! The problem is easy to check: At the same time you have a sharp image (Screen 1) and a blurred one (screen2).
    Images came from Canon EOS 50D raw file.
    Does this problem know? Any idea to solve it?

    I'm having a similar problem on my Mac Pro with an Apple 23" as Monitor 1 and a Samsung 21" in Portrait orientation as Monitor 2.  Sometimes, even though full 1:1 previews have been rendered, when I zoom to the 1:1 view on Monitor 2 (usually with the Grid View on Monitor 1), it zooms in but never loads the 1:1 preview, so the image is blurry.
    The only solution I've found is to restart Lightroom.

  • Drawing images gives 2 different results with the same code.

    Im adding my code on here, and its sort of long but ill try to explain it. Most of it you can ignore.
    Anyway i'm making a tree menu with only 1 level of expansion. So you have a TreeMenu object, and this object has some Branch classes. These Branch classes have Leaf classes. That is all. On the menu there is also a little box where you can click to expand and collapse each branch. if a branch is expanded, all of its leaves are shown. if it is collapsed only the branch name is shown.
    So far what I've described above works, there is a small scale compilable working program, that is alright. Theres just a few bugs to fix.
    A little feature of the tree is if a branch or a leaf is selected (has been clicked on in the past) it has a blue background. This sort of works. The branch names seem to work alright, and some of the leaves. However other if you run the example i provided you can click on Leaf 1, and it will be ok, but if you click on Leaf 2 then there blue background is twice as big as it should be. But for the rest, it works ok.
    This is weird to me because the same code handles any of these same situations. So it seems that i get 2 diferent results with the same code. If anyone would like to help heres some stuff you should know:
    You can ignore Leaf class, i dont think theres any errors in there.
    You can ignore just about all of Branch class except the update() method.
    You can ignore all of TreeMenu class except the inner MouseListener class might be useful.
    You can ignore TreeTester. Just the JFrame tester class.
    to run the code:
    javac TreeMenu.java
    java TreeMenu
    http://cs.ucsb.edu/~jsterling/treemenu.zip
    thanks.

    You make a good point Stefan but unfortunately I already checked that.  I have even copied the mapping (right click copy) and pasted it from the working Mapping to the bad Map (Paste) to make sure the context values were all the same.
    I also opened all the queues and compared the values in each.  All values match exactly except for the result(out) queue.
    In both tests I am using the same IDOC XML file. 
    These are the only differences I see.
    1.  The IDOC is exactly the same as far as I can tell but they come from two different source SWCV.  SAP APPL 4.7 and Steelcase_Procurement (ECC 6.0). 
    2.  The working map uses a local UDF.  The bad map calls the UDF from a Function Group.  Is there a Java version difference between the two?
    A better sample of the result queues look like this:
    Correct Result:
    Thickness of Glass: 20
    Height: 10
    Width: 5
    Length: 18
    Thickness of Glass: 10
    Height: 15
    Width: 8
    Length: 14
    Bad Result:
    Thickness of Glass: 20
    <null>
    <null>
    <null>
    Width: 5
    <null>
    <null>
    <null>
    I took this chance to redesign my Variant Config output to separate the characteristics/values, but I'm still bothered that I was unable to determine what would cause the differing values.
    Any ideas?
    Thanks,
    Matt

  • Same code, different result

    I have been using Javascript to create popups in Creator using the onclick property of a button or hyperlink.
    Today any popups created fail with the message:
    HTTP Status 500 -
    type Exception report
    message description The server encountered an internal error () that prevented it from fulfilling this request.
    exception javax.servlet.ServletException: Cannot find FacesContext
    Strangely the popups created earlier still work OK.
    How can Creator cause code that works in older pages not work when cut and pasted into new pages?
    After all the Javascript is standard stuff widely used across the web.
    In the <head> tag I have
    <script Language="JavaScript1.2">
                    function popup(url, name, left, top, width, height)
                    settings=
                    "toolbar=no,location=no,directories=no,"+
                    "status=no,menubar=no,scrollbars=yes,"+
                    "left="+left+",top="+top+","+
                    "resizable=yes,width="+width+",height="+height;
                    MyNewWindow=window.open(url,name,settings);
                    MyNewWindow.focus();
                </script>          and in the link the code is
    <h:outputLink binding="#{yayw$yayw13Content.yw13hyperlink6}" id="yw13hyperlink6"
                    onclick="popup('AidPopup.jsp', 'WinKC6', 150, 250, 600, 200); return false;" styleClass="tabProps">
                    <h:outputText binding="#{yayw$yayw13Content.ywhyperlink6Text}" id="ywhyperlink6Text" styleClass="cmdLnk" value="#{c.w130}"/>
                </h:outputLink>where AidPopup.jsp is the jsp page tp pop up when called by the link.
    The calling page and the popup page are in the same folder.
    Thanks for any advice on this problem.
    John.

    It turns out the solution is that the full path to the popup file has to be given for the URL. So in the example above the code for the link should be
    <h:outputLink binding="#{exer$exer1Content.hyperlink1}" id="hyperlink1" onclick="popup('/attain/faces/exer/RefocusPop.jsp', 'WinRef', 150, 250, 600, 200); return false;">
       <h:outputText binding="#{exer$exer1Content.hyperlink1Text}" id="hyperlink1Text" value="#{es.ex1}"/>
    </h:outputLink>The project name is Attain and exer is a sub-directory containing the calling page and the RefocusPop.jsp.
    I'll leave it to someone at Sun to explain the mystery of why pages written up to a few days ago still work on the old code but new pages must use a full path for them to work.
    John.

  • Same code, different result (load the library...)

    I have to use external library. So I programmed short code. But...
    It's work in Illustrator CS3
    var samplelib= 'C:/Program Files (x86)/Adobe/Adobe Bridge CS3/webaccesslib.dll';
    mylib = new ExternalObject ("lib:" + samplelib);
    alert(mylib.version) ;
    It's NOT WORK in Illustrator CS5
    var samplelib= 'C:/Program Files (x86)/Adobe/Adobe Bridge CS5/webaccesslib.dll';
    mylib = new ExternalObject ("lib:" + samplelib);
    alert(mylib.version) ;
    Extend Script Toolkit talk to me : 'I/O error'(i uploded capture image below)
    I don't know what I missed. Could you let me know what I wrong?
    Thank you for reading.
    p.s. I'm using windows7.

    Hi kimDino8,
    Can you check the file path again?
    In my opinion the path should be (sorry, I can't check this here at home - perhaps this is the path for CS5.5):
    var samplelib= 'C:/Program Files (x86)/Adobe/Adobe Bridge CS5.1/webaccesslib.dll';

  • PSD & PSB - 2files, same image, same size, same dpi, any difference?

    Hello Everyone
    I need some help on just clarifying this:
    If i had a image:
    Size: 60mm x 80mm
    Dpi: 300
    ..with a photo of a flower or something
    IF i save it as a PSD and another exact file but in PSB
    would there be any difference in quality or resolution between the 2 files? (as in will it be blurry on one of them or vis versa?)
    Thanks in advance
    Darrel

    The problems you are having are in part due to IDCS3 and in part due to Leopard. Do a search in this forum for "color printing InDesign".
    Al

  • How to manage multiple sizes of the same image?

    I recently took up LightRoom for all the good things it does. One of the things I need to do, however, is to create and manage multiple sizes of the same image needed for different purposes. I always found this cumbersome. I totally expected that the LR library would offer a solution for this but I looked and I didn't see anything. Sure you can export and resize in the process but then you're on your own. Am I missing something? Isn't there a better way? What does Adobe have in mind for best practices and how do you handle this?

    I can't speak for 99jon, but when I need multiple sizes, I export at the desired sizes, and then make use of the exported photos (upload, e-mail, whatever) and then delete the exports. Thus, there's really no need for me to keep track of the photo at this specific size, knowing that if I ever need it again -- unlikely -- I can regenerate it with the export pre-set, so I put no effort (zero!) into keeping track of photos at different sizes.
    The idea of adding it back into the catalog doesn't get me excited, and I would advise against it. I don't need this, and I don't see the benefit of keeping this particular size export for the long-term. As I said, I can always recreate it — but maybe you have such a need to keep these exports long-term and recreating it at a later point in time doesn't meet your needs? Can you explain?
    By the way, you can't resize a virtual copy, so that won't work here. The only time you can resize is on export.

  • Same code gives different results in Matlab Script in Labview and Matlab

    I am implemeting a Matlab code into a LabVIEW application using Matlab script. When I import the exactly same code to the Matlab Script in LabVIEW it gives a different result than it is in Matlab. This code is a simulation code including first kind bessel functions. Using LabVIEW 7.1 and Matlab R14 service pack 3.

    Labview 8.5
    Matlab R2009b
    Attached are the graphs produced by matlab script in labview and in matlab.
    The minimum of graph produced by matlab code is below 1 and that in labview is above 1.
    Thanks a lot for your reply.
    Sorry, I haven't quantified the "sometimes" yet. 
    Attachments:
    matlabsResult.jpg ‏29 KB
    LV.png ‏84 KB

  • Same C++ code gives different result in MacOSX and Ubuntu

    Hi
    I have a C++ program which starts by reading an external file, but changing the name of the file give me different results.
    I selected just the important part and made a simple file with the reading part of my program and can be downloaded here
    http://dl.dropbox.com/u/664351/files.zip
    It just reads the external file and does the output of some values.
    It has two external file examples. If one uses "x.txt" everything works fine, but if we use "dados.txt", which is a copy of "x.txt", the last value in the output is wrong.
    The stranger is that if i use these same files in ubuntu everything works just fine!
    I tried in a MacBook, a MacBook Pro and an iMac (all of them with macosx 10.6) and i always got the error, but not on ubuntu!
    Does anyone has a clue about what is happening here?
    Cheers,
    Marcelo

    marcelobarbosa wrote:
    Does anyone has a clue about what is happening here?
    Change OutFile from a 20 byte character array to a string. GCC isn't able to tell what type that is and is picking int or something, corrupting your memory.

Maybe you are looking for

  • Releasing billing doc to accounting with FICO Interface problem

    Dear all, I have problem while releasing billing doc to accounting. When I use TCODE VF02, to release, I got the message : Condition type MWST tax code A1 does not exist Message no. FF762 Diagnosis When calculating tax, the system tried to determine

  • Selection Field in Report Painter Report

    Dear All, Could any one tell me the procedure to add new field at selection screen for the report painter report ? To change the report painter selection screen i have to change the Report group or Report of the report group? Thank in stack

  • Reader 11 keeps deleting itself

    Hi there, I just upgraded a network of around 150 users to reader 11 from 10 and am having a problem. All of the workstations are running windows 7 by the way. I install reader, use it for about a day and then it mysteriously vanishes. Fr some users

  • Error -5000 and Importing

    First off, how in the world do you import a video with this software? I've never been more frustrated. I'm starting with .3g2 files (from my phone), and I've tried converting to H.264 MP4 and M4V files and converting to DV from Quicktime Pro. iMovie

  • HT4913 how do I add and older ios device to my itunes account?

    How do I add or change an older IOS device (IPad), to my Itunes account from the previous owners account?