Relatively poor BitmapData.encode JPEG performance (iOS)

Hi,
Our app currently uses a native extension to access the inbulit JPEG encoder in iOS (UIImageJPEGRepresentation(...)). With a quality setting of 0.6 (not sure if that relates to standard JPEG quality settings) and a image size of 640x360, a typical encode operation takes 18ms on an iPhone 4S.
I just tested the new BitmapData.encode functionality with the hope of migrating from using a native extension, but even at a quality of zero i'm seeing encode times around 49ms. At a quality of 60 it's not much slower (52-53ms) although it does return a file less than half the size of the native encoder.
Have you considered wrapping the iOS SDK encoder, or if you are, should it be taking so much longer?
My native encoding extension implementation: http://pastebin.com/VS1jhKB8
By the way, really enjoying the momentum behind the Air releases!
Cheers,
Dave

Well, in general I operate on the princiapal that removing code is a good thing
I can see what you're saying about Native Extensions, however in this case since they've just added a JPEG encoder to the API it might make sense to use the fastest one available. However I can also see that they might prefer consistent behaviour over execution speed - no doubt the iOS native JPEG encoder will produce a different result than the Android one (http://pastebin.com/vu6BeE5p)

Similar Messages

  • Aleatory One factory fails for the operation "encode"-JPEG

    I've a very strange problem with JAI.write using JPEG, but is happening aleatory. Some times it works, some times I get the exception and some other times don't. What I've seen is that when I got first this error, then all the rest of the images throws it. I mean, I'm working OK and then I got the exception, from there, all the images, no matter that they were not trowing exceptions before, now they do, so I don't know what is happening. I'll post some code snippets and the full stack trace of the exception. Hope you can help me:
    First, I have a class that is a JSP-Tag:
    RenderedOp outputImage = JAI.create("fileload", imgFile.getAbsolutePath());
    int widthSize = outputImage.getWidth();
    int heightSize = outputImage.getHeight();
    try{
        outputImage.dispose();                         
    }catch(Exception e){}
    outputImage = null;That's the first thing, now, the second, this is a Servlet that writes the image to the browser (GetImageServlet its name, which appears in the stack trace):
    FileSeekableStream fss = new FileSeekableStream(file);
    RenderedOp outputImage = JAI.create("stream", fss);
    int widthSize = outputImage.getWidth();
    int heightSize = outputImage.getHeight();
    if ((outputImage.getWidth() > 0) && (outputImage.getHeight() > 0)) {
                        if ((isThumbnail) && ((outputImage.getWidth() > 60) || (outputImage.getHeight() > 60))) {
                             outputImage = ImageManagerJAI.thumbnail(outputImage, 60);
                        } else if (outputRotate != 0) {
                             outputImage = ImageManagerJAI.rotate(outputImage, outputRotate);
                        OutputStream os = resp.getOutputStream();
    resp.setContentType("image/jpeg");
         ImageManagerJAI.writeResult(os, outputImage, "JPEG");
                        outputImage.dispose();
                        os.flush();
                        os.close();
    outputImage = null;
    imgFile = null;The code of ImageManagerJAI.writeResult, which is a method I use above:
    public static void writeResult(OutputStream os, RenderedOp image, String type) throws IOException {
              if ("GIF".equals(type)) {
                   GifEncoder encoder = new GifEncoder(image.getAsBufferedImage(), os);
                   encoder.encode();
              } else {
                   JAI.create("encode", image, os, type, null);
         }And the full exception trace is:
    Error: One factory fails for the operation "encode"
    Occurs in: javax.media.jai.ThreadSafeOperationRegistry
    java.lang.reflect.InvocationTargetException
         at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
         at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
         at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
         at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
         at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819)
         at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:867)
         at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:888)
         at javax.media.jai.JAI.createNS(JAI.java:1099)
         at javax.media.jai.JAI.create(JAI.java:973)
         at javax.media.jai.JAI.create(JAI.java:1668)
         at com.syc.image.ImageManagerJAI.writeResult(ImageManagerJAI.java:27)
         at GetImageServlet.doGet(GetImageServlet.java:214)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: com.sun.media.jai.codecimpl.util.ImagingException
         at com.sun.media.jai.codecimpl.ImagingListenerProxy.errorOccurred(ImagingListenerProxy.java:63)
         at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:280)
         at com.sun.media.jai.opimage.EncodeRIF.create(EncodeRIF.java:70)
         ... 31 more
    Caused by: com.sun.media.jai.codecimpl.util.ImagingException: IOException occurs when encode the image.
         ... 33 more
    Caused by: java.io.IOException: reading encoded JPEG Stream
         at sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(Native Method)
         at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:472)
         at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:228)
         at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:277)
         ... 32 more
    javax.media.jai.util.ImagingException: All factories fail for the operation "encode"
         at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1687)
         at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
         at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
         at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819)
         at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:867)
         at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:888)
         at javax.media.jai.JAI.createNS(JAI.java:1099)
         at javax.media.jai.JAI.create(JAI.java:973)
         at javax.media.jai.JAI.create(JAI.java:1668)
         at com.syc.image.ImageManagerJAI.writeResult(ImageManagerJAI.java:27)
         at GetImageServlet.doGet(GetImageServlet.java:214)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
         at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
         ... 26 more
    Caused by: com.sun.media.jai.codecimpl.util.ImagingException
         at com.sun.media.jai.codecimpl.ImagingListenerProxy.errorOccurred(ImagingListenerProxy.java:63)
         at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:280)
         at com.sun.media.jai.opimage.EncodeRIF.create(EncodeRIF.java:70)
         ... 31 more
    Caused by: com.sun.media.jai.codecimpl.util.ImagingException: IOException occurs when encode the image.
         ... 33 more
    Caused by: java.io.IOException: reading encoded JPEG Stream
         at sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(Native Method)
         at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:472)
         at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:228)
         at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:277)
         ... 32 more
    Caused by:
    java.lang.reflect.InvocationTargetException
         at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
         at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
         at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
         at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
         at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819)
         at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:867)
         at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:888)
         at javax.media.jai.JAI.createNS(JAI.java:1099)
         at javax.media.jai.JAI.create(JAI.java:973)
         at javax.media.jai.JAI.create(JAI.java:1668)
         at com.syc.image.ImageManagerJAI.writeResult(ImageManagerJAI.java:27)
         at GetImageServlet.doGet(GetImageServlet.java:214)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: com.sun.media.jai.codecimpl.util.ImagingException
         at com.sun.media.jai.codecimpl.ImagingListenerProxy.errorOccurred(ImagingListenerProxy.java:63)
         at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:280)
         at com.sun.media.jai.opimage.EncodeRIF.create(EncodeRIF.java:70)
         ... 31 more
    Caused by: com.sun.media.jai.codecimpl.util.ImagingException: IOException occurs when encode the image.
         ... 33 more
    Caused by: java.io.IOException: reading encoded JPEG Stream
         at sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(Native Method)
         at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:472)
         at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:228)
         at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:277)
         ... 32 moreI'm using JDK 1.6, Tomcat 5.5, Windows XP, and JAI 1.1.2_01 (the jars are in the WEB-INF/lib of the project AND in the jdk 6/jre/lib/ext, while the dlls are only on jdk 6/jre/bin)
    Please help, I don't know what to do, I've weeks with this problem. Dukes available pleaseeee!

    Hi
    you can check if you get in the error logs an message like 'Could not load mediaLib accelerator wrapper classes. Continuing in pure Java mode.' may be the problem of JAI native accelerator

  • Problem while encoding JPEG image from JFrame paintComponent in a servlet

    Hello!
    I m developing webapplication in which I made one servlet that calls JFrame developed by me, and then encoding into JPEG image to send response on client browser. I m working on NetBeans 5.5 and the same code runs well. But my hosting server is Linux and I m getting the following error:
    java.awt.HeadlessException:
    No X11 DISPLAY variable was set, but this program performed an operation which requires it.
         java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
         java.awt.Window.<init>(Window.java:406)
         java.awt.Frame.<init>(Frame.java:402)
         java.awt.Frame.<init>(Frame.java:367)
         javax.swing.JFrame.<init>(JFrame.java:163)
         pinkConfigBeans.pinkInfo.pinkModel.pinkChartsLib.PinkChartFrame.<init>(PinkChartFrame.java:36)
         pinkConfigBeans.pinkController.showLastDayRevenueChart.processRequest(showLastDayRevenueChart.java:77)
         pinkConfigBeans.pinkController.showLastDayRevenueChart.doGet(showLastDayRevenueChart.java:107)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.
    I m building the application in NetBeans and when runs then it runs well, even while browsing from LAN. But when I place the web folder creted under buil directory of NetBeans in the Tomcat on Linux, then it gives above error.
    Under given is the servlet code raising exception
    response.setContentType("image/jpeg"); // Assign correct content-type
    ServletOutputStream out = response.getOutputStream();
    /* TODO GUI output on JFrame */
    PinkChartFrame pinkChartFrame;
    pinkChartFrame = new PinkChartFrame(ssnGUIAttrInfo.getXjFrame(), ssnGUIAttrInfo.getYjFrame(), headingText, xCordText, yCordText, totalRevenueDataList);
    pinkChartFrame.setTitle("[::]AMS MIS[::] Monthly Revenue Chart");
    pinkChartFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    //pinkChartFrame.setVisible(true);
    //pinkChartFrame.plotDataGUI();
    int width = 760;
    int height = 460;
    try {
    BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = image.createGraphics();
    pinkChartFrame.pinkChartJPanel.paintComponent(g2);
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    encoder.encode(image);
    } catch (ImageFormatException ex) {
    ex.printStackTrace();
    response.sendRedirect("index.jsp");
    } catch (IOException ex) {
    ex.printStackTrace();
    response.sendRedirect("index.jsp");
    out.flush();
    Do resolve anybody!
    Edited by: pinkVag on Oct 15, 2007 10:19 PM

    >
    I m developing webapplication in which I made one servlet that calls JFrame developed by me, and then encoding into JPEG image to send response on client browser. I m working on NetBeans 5.5 and the same code runs well. But my hosting server is Linux and I m getting the following error:
    java.awt.HeadlessException: >That makes sense. It is saying that you cannot open a JFrame in an environment (the server) that does not support GUIs!
    To make this so it will work on the server, it will need to be recoded so that it uses the command line only - no GUI.
    What is it exactly that PinkChartFrame is generated an image of? What does it do? (OK probably 'generate a chart') But what APIs does it use (JFreeChart or such)?

  • Saving BitmapData as jpeg file

    I've been working on an AIR image editing application for a
    few weeks now and i'm suddenly realizing that there seems to be no
    easy way to save BitmapData as a JPEG file. I have found flash
    examples that call php scripts in order to save jpegs, but is this
    even possible when running only local code? How can I do this???
    Will this functionality be available any time soon? Any suggests of
    ways to do this would be GREATLY appreciated.
    Thanks!

    Well I have only used the JPGEncoder class, but the
    PNGEncoder seems to work the same way... All I needed was something
    to take my BitmapData object and give me a ByteArray that can be
    written to meet the jpeg format specification. So basically, you'd
    do something like this:
    //assuming you already have some BitmapData called
    myBitmapData
    var stream:FileStream = new FileStream();
    stream.open(newFile, FileMode.WRITE);
    var bytes:ByteArray = new PNGEncoder().encode(myBitmapData);
    stream.writeBytes(bytes);
    stream.close();
    If you need to do something a little different, you might
    need to look through the functions in the PNGEncoder class a little
    more.
    Also, if you were implying you're actually confused as to how
    to import the corelib, you should be able to either import it as a
    new project or import the com.adobe.images package into your
    current project and use the classes that way.
    Hopefully this helps... I'm still sorta just getting the hang
    of this stuff myself.

  • How to save a BufferredImage with RGB color encoded JPEG file.

    Hi, I am new to Java Imaging API programming.
    When I try to write a BufferredImage using following code -
    BufferedImage output = new BufferedImage (width, height, BufferedImage.TYPE_INT_ARGB);
    // Save
    File outputFile = new File("image.jpeg");
    ImageIO.write(output, "jpeg", outputFile);
    It seems that myfile.jpg have CMYK color encoding, Can someone tell me how can I save the BufferredImage with RGB color encoding.
    Thanks,
    Sanjay Ujjainkar

    how to format the text ?
    i have format ted the text but it seems not work!
    Message was edited by:
    Enjoyfans

  • Encoding: Best Performance vs. Best Quality

    So I have a project that if I select Best Performance it shows that the DVD will be 3.4GB, and if I select Best Quality it shows the DVD will be 2.0GB.
    So my question is: isn't that contrary to logic? Why wouldn't Best Quality be the largest size? Is Best Quality going to give me the best possible video quality?

    Since you have posted to the iDVD 6 forum, I asssume that is what you have.
    iDVD 6 has two encoding modes: 'Best Performance' and 'Best Quality'. iDVD '08 adds: 'Professional Quality'.
    People misunderstand the names and I wish Apple had used different names for all three modes.
    The below applies to a single layer disc (double the times for a double layer disc):
    'Best Performance' uses a fixed video encoding bit-rate that produces a DVD with a data playback bit-rate just about as high as a set-top DVD player can handle. This limits content to 60 minutes or less.
    'Best Quality' uses a fixed video encoding bit-rate that is BASED ON THE TOTAL AMOUNT OF CONTENT BEING COMPRESSED and is best suited for content between 60 and 120 minutes. Note that all the content is encoded at the same bit-rate so that it can fit on a single layer disc. (Apple calls this single-pass variable bit-rate encoding because 120 minutes of content gets compressed more than 60 minutes of content.)
    The new 'Professional Quality' uses a variable video encoding bit-rate that is BASED ON THE INFORMATION IN THE CONTENT BEING COMPRESSED. It uses a two-pass process to first evaluate the content and then encode it based on the motion/detail of individual clips. It is best suited for content between 60 and 120 minutes. Note that not all the content is encoded at the same bit-rate BUT the maximum data bit-rate on playback can not exceed the playback capability of a set-top DVD player. (This is two-pass, variable bit-rate encoding.) This means the BEST encoded quality should be about what is obtained with 'Best Performance' for content under 60 minutes.
    If your content is under 60 minutes, use 'Best Performance'. If your content is between 60 minutes and 120 minutes, use 'Professional Quality' if your processor is fast enough and you don't mind waiting about twice the time required for 'Best Quality'.
    About the only thing Apple can do to further improve the quality of DVD encoded video is to offer compressed audio instead of just the present uncompressed PCM audio because the audio 'eats up' part of the playback bit-rate a set-top DVD player can handle. Compressed audio would make more of the maximum playback bit-rate available for video.
    In your case, with iDVD 6, use 'Best Performance' for content under 60 minutes and 'Best Quality' for content over 60 minutes. Remember that your menu content counts against the total time limit.
    F Shippey

  • Encoding JPEG renders "blurry"

    I have created a java servlet that dynamically renders an image for use as a heading for each page. The servlets works fine, except for when a "background image" is used to go behind the text.
    Here is what the result looks like:
    http://www.mikelukenonline.com/servlets/lmp-framework?page_name=dynamicText&fontName=Old%20English%20Text%20MT&fontColor=168~167~167&shaddow=Y&fontSize=28&backgroundColor=white&text=Welcome%20to%20this%20site&width=500&x=11&y=21&height=34&backgroundImage=http://www.mikelukenonline.com/images/headings/titleblank2.jpg
    One of the parameters in the URL is called "backgroundImage" which takes a URL of a jpg and draws that first. In this example, the background image is:
    http://www.mikelukenonline.com/images/headings/titleblank2.jpg
    Now if you look at the background image that I just listed, you see that it looks pretty clear. However, if you look at the full link above, you can see that the baclground image is "blurry" or "pixilated" - not sure the best work to describe it!
    It is also worth noting that it is only when using the background image that it looks bad. If you remove the backgroundImage parameter, the text is rendered just fine:
    http://www.mikelukenonline.com/servlets/lmp-framework?page_name=dynamicText&fontName=Old%20English%20Text%20MT&fontColor=168~167~167&shaddow=Y&fontSize=28&backgroundColor=white&text=Welcome%20to%20this%20site&width=500&x=11&y=21&height=34
    I have tried everything I can think of and I can't get past this issue. Below are samples from the servlet. Any thoughts at all would be greatly appreciated!
    This is the code that "draws" the final image:
    private java.awt.Graphics.Graphics graphics = null;
    private java.awt.Image.Image image = null;
    private java.awt.Frame.Frame frame = null;
    public Image getImage(){
         drawImage();
         if (image == null)
              image = getFrame().createImage(getWidth(), getHeight());
         return image;
    private Frame getFrame() {
         frame = new Frame();
         frame.addNotify();
         return frame;
    private Graphics getGraphics() {
         if ( image == null )
              image = getFrame().createImage(getWidth(), getHeight());
         if ( graphics == null )
              graphics = image.getGraphics();
         return graphics;
    private void drawImage() {
         getGraphics().setColor(getBackgroundColor());
         getGraphics().fillRect(0, 0, getWidth(), getHeight());
         getGraphics().setColor(Color.white);
         if(getBackgroundImage() != null && getBackgroundImage().trim().length() > 0) {
              try {
                   Frame f = new Frame();
                   f.addNotify(); 
                   Image im = Toolkit.getDefaultToolkit().createImage(new URL(getBackgroundImage()));
                   MediaTracker mt = new MediaTracker(f);
                   mt.addImage(im, 0);           
                   mt.waitForAll();
                   getGraphics().drawImage(im,0,0,null);
                   im.flush();
                   im = null;
                   f.removeNotify();
                   frame = null;
              } catch (Exception e) {}     
         Font f = null;
         try {
              f = new Font(getFontName(), Font.PLAIN, getFontSize());
         } catch (Exception e) {
              f = new Font("TimesRoman", Font.PLAIN, getFontSize());
         getGraphics().setFont(f);          
         if(showShaddow()) {
              getGraphics().setColor(new Color(229, 229, 229));     
              getGraphics().drawString(getText(),getXPos()+3,getYPos()+3);
         getGraphics().setColor(getFontColor());
         getGraphics().drawString(getText(),getXPos(),getYPos());     
    }This is part of a class later that takes this image and encodes it and renders it to the browser:
    public void transform(HttpServletRequest request, HttpServletResponse response) {
         try {
              Frame frame = null;       
              Graphics graphics = null;       
              try {           
                   frame = new Frame();           
                   frame.addNotify();           
                   MediaTracker mt = new MediaTracker(frame);
                   Image image = getImage(); // returns the image from the previous code
                   mt.addImage(image, 0);           
                   mt.waitForAll();           
                   int w = image.getWidth(frame);           
                   int h = image.getHeight(frame); 
                   BufferedImage offscreen = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);       
                   graphics = offscreen.getGraphics();    
                   graphics.drawImage(image, 0, 0, frame);           
                         graphics.dispose();
                   com.sun.image.codec.jpeg.JPEGImageEncoder encoder = com.sun.image.codec.jpeg.JPEGCodec.createJPEGEncoder(response.getOutputStream());
                   com.sun.image.codec.jpeg.JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(offscreen);
                   param.setQuality(1, false);
                   encoder.setJPEGEncodeParam(param);   
                   encoder.encode(offscreen);      
              } catch (Exception e) {
              } finally {           
                   if (graphics != null) {               
                        graphics.dispose();           
                   if (frame != null) {               
                        frame.removeNotify();           
                   getImage().flush();
                   response.flushBuffer();
         } catch (Exception e) {}
    }

    Hi,
    Well, you could try fixing the memory leak in
    JPEGAsyncDecoder. :)

  • Encoding JPEG images

    In my application, I have to encode different image and save
    them to disk. I tried using JPEGEncoder but it's slow (hangs the
    application while being executed). I tried JPEGAsyncEncoder but it
    has a memory leak
    http://blog.paranoidferret.com/index.php/2007/12/11/flex-tutorial-an-asynchronous-jpeg-enc oder/
    Any suggestions on what to try next ? I use Javascript/HTML
    on adobe AIR.

    Hi,
    Well, you could try fixing the memory leak in
    JPEGAsyncDecoder. :)

  • Upload of exif encoded JPEG's not working in FF

    .Hey,
    Just starin this thread to get everyones input/comments/suggestions on handling this interesting issue.
    I have a script that uploads jpeg's. When I do the upload from the hard drive all works well in IE, FF, and Safari. When done directly from a camera it works in IE, but not in FF or Safari. I get an error saying the file is not an image. The camera (canon) saves images in JPG format and the script allows uploads of jpg, jpeg, png, gif.
    Upon doing some research i found out that the camera 'encodes' the JPEG by way of EXIF to add image data to the JPEG, but its still a JPEG.
    At first i thought it was the script but since it works in IE, i was told that it cant be... I have a discussion going on about it in another forum provided by the company I purchased this upload script from. You can see it at http://www.webassist.com/forums/showthread.php?t=4783. I'm staring to think its a browser issue and wonder how to 'accomadate' for such... I am using cs4 with vista 64 and the latest version of all browsers.  there has to be a way to accomadate for the inconsistency across browsers without changing the file extension or putting the images on the harddrive first... I want convenience for my users.... any ideas?

    I am having a very similar issue, but the reverse - IE9 doesn't work, but IE8, FF, and Chrome all work fine.  The error:
    SCRIPT5007: Unable to get value of the property 'split': object is null or undefined  -->  Line 43: _10d=_10c.split("/");
    The field has both name and id, as does the CFFORM. (There is only one CFFORM on the page.)  I am event calling the CFAJAXIMPORT at the beginning of the file.
    <cfajaximport  tags="cfform,cftextarea,CFINPUT-DATEFIELD">
    <cfform name="registration" id="registration" method="post" action="#cgi.SCRIPT_NAME#"> 
    Funny thing though, on the exact same code, but in another page, it works fine in all browsers.
    <cfinput  type="datefield" name="udf_43" id="udf_43" class="editbody" style="width:255px;" validate="date" validateat="ONSUBMIT"
    required="yes" message="Required Field: Please enter the information for - BIRTHDATE.">
    So, what is the fix?

  • AS3 BitmapData to Jpeg to SqlLite database to BitmapData

    Hi,
    using AS3, for an AIR application, I have a BitmapData object (obtained from webcam shot). I need to compress the image with JPEGEncoder and save it in a SQLLIte database (string?).
    And then I need to re-build the BitmapData object using the data stored in the database.
    It's importante the passage of the jpeg compression!
    Has someone an idea about how to implement this?
    THANK YOU IN ADVACE!

    the jpegencoder constructor accepts a quality parameter (and you can use the jpegencoderoptions class) to compress the file.
    here's more info:  Adobe Flash Platform * Compressing bitmap data

  • Preserving Meta Data when encoding JPEG (JAI)

    I have a project where the requirements are that images which I compress (using the JPEG encoder of JAI) must be as much compressed as possible, but also must not be altered in any other way from the original image file, i.e. things like meta data must be preserved exactly as it was, and preferably other things in the header (such as resolution) should also be preserved.
    I have had no problems with the compression process as such, but unfortunately it seems that JAI writes a fresh new (default) header every time the compressed (encoded) image is written out. I also tried the new Java Image I/O stuff for doing this, and it seems to have exactly the same behaviour.
    I have searched both thses APIs extesively for something which would enable me simply to set the option that original meta data (and preferably all header data) should be preserved, but to no avail.
    I do realize that image meta data can be both read and written (at least using the Image I/O), but I find it quite complex and also find it a pitty and a waste to have to do that when the requirements are not about altering/processing any of this data, but simply about leaving it alone.
    If any one has any suggestions about how this problem might be solved, I would be very interested to know about it, and very greatful for any hints or pointers to information also.
    Thank you.
    Helgi

    What do you meen about meta-data??? Can you provide an example.....
    i.e. an initial image you have, in what format is in, it's meta-data (as you say ) and what you finally get encoding

  • Battery performance ios 4.3.3

    How about battery performance on  iOS 4.3.3?

    MOSHINSKI wrote:
    How about battery performance on  iOS 4.3.3?
    Mine is about the same as it was in 4.3.2, 4.3.1 and 4.3. But 4.3 was better than 4.2.x.

  • Poor wifi streaming and performance on ipad air

    With my 32GB ipad air I'm trying to stream video down both from youtube through the stsandard app and also from my kingston MobileLite Wifi media streamer.
      In both cases the wifi performance appears shockingly bad at times with regular instances of the youtube videos shifting to low quality resolution and sound and the Wifi streamer device refusing to play any large file at all, plus taking an absolute age to load documents etc.
      I've tried with the ipad Air running through my hub at home and also via this device and the performance is shocking compared to my iphone 4s.  I loaded a 2gb movie on the phone and bar one stutter at the start it played with no issues, whereas the ipad refused to load anything.  Even movies I have shot on the iphone then copied across to the streamer play incredably slowly.
      As this is happening when using two or three seperate wifi routes then it's got to be something to do with the pad....
    Any ideas?
    Stu.

    No difference between iPad 2 and 1 on Wi-Fi here..
    Try here >  iOS: Troubleshooting Wi-Fi networks and connections
    Please stop creating multiple threads for the same topic >   https://discussions.apple.com/message/23704385#23704385

  • Poor speed and fluctuation performance

    Hi just got infinity 2 installed on 02/09/14 and experiancing poor speeds. getting on average 20Mb Dl and 12UL. I am 100meters from the exchange box, with new wiring to house and throughout. my profile is (see below) tried restarting router disconnecting everything etc but to no avail, is it possible that my profile needs to be reset. Any help would be greatly recieved. My neighbour is getting 78Mb Dl
    Thanks 
    Gregg
    Telephone Number 019468xxxxx on Exchange EGREMONT is served by Cabinet 8
    Featured ProductsDownstream Line Rate(Mbps)Upstream Line Rate(Mbps)Downstream Range(Mbps)Availability Date  High Low High Low    
    FTTC Range A (Clean)
    80
    80
    20
    20
    Available
    FTTC Range B (Impacted)
    80
    70.5
    20
    19
    Available
    WBC ADSL 2+
    Up to 2
    1 to 3.5
    Available
    ADSL Max
    Up to 1.5
    1 to 2.5
    Available
    WBC Fixed Rate
    0.5
    Available
    Fixed Rate
    0.5
    Available
    Other Offerings
    Fibre Multicast
    Available
    Copper Multicast
    Available

    Is this normal from event log??? not .74 is my PC
    22:12:09, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57872-​>213.1.72.209:80 on ppp3)
    22:12:04, 22 Sep.
    BLOCKED 1 more packets (because of Packet invalid in connection)
    22:12:02, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57889-​>66.235.139.204:443 on ppp3)
    22:11:40, 22 Sep.
    BLOCKED 75 more packets (because of Packet invalid in connection)
    22:11:38, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57854-​>193.113.4.154:7778 on ppp3)
    22:11:36, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57856-​>17.158.10.43:443 on ppp3)
    22:10:20, 22 Sep.
    OUT: BLOCK [65] First packet is Invalid (TCP 192.168.1.74:57789-​>193.113.8.193:80 on ppp3)
    22:10:18, 22 Sep.
    BLOCKED 1 more packets (because of First packet is Invalid)
    22:10:16, 22 Sep.
    OUT: BLOCK [65] First packet is Invalid (TCP 192.168.1.74:57789-​>193.113.8.193:80 on ppp3)
    22:09:59, 22 Sep.
    BLOCKED 1 more packets (because of Packet invalid in connection)
    22:09:58, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57774-​>108.160.166.12:443 on ppp3)
    22:09:44, 22 Sep.
    BLOCKED 175 more packets (because of Packet invalid in connection)
    22:09:42, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57804-​>213.1.72.209:80 on ppp3)
    22:09:42, 22 Sep.
    BLOCKED 73 more packets (because of Packet invalid in connection)
    22:09:42, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57803-​>213.1.72.209:80 on ppp3)
    22:09:34, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57807-​>17.158.10.43:443 on ppp3)
    22:09:30, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57760-​>93.184.220.97:443 on ppp3)
    22:09:26, 22 Sep.
    BLOCKED 1 more packets (because of Packet invalid in connection)
    22:09:24, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57753-​>66.235.139.206:443 on ppp3)
    22:08:00, 22 Sep.
    BLOCKED 2 more packets (because of Packet invalid in connection)
    22:07:59, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57732-​>93.184.220.97:443 on ppp3)
    22:07:33, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57736-​>17.158.10.43:443 on ppp3)
    22:06:46, 22 Sep.
    BLOCKED 16 more packets (because of Packet invalid in connection)
    22:06:44, 22 Sep.
    OUT: BLOCK [9] Packet invalid in connection (TCP 192.168.1.74:57708-​>173.222.210.17:80 on ppp3)
    22:05:54, 22 Sep.
    IN: BLOCK [16] Remote administration (TCP 65.40.56.3:53978-​>86.153.86.212:80 on ppp3)

  • Poor Lightroom 5.7 Performance when using part repair tool

    Hi Lightroom pros,
    I'm using Lightroom 5.7 for about half a year and are very happy with it. Unless I'm working on photos where I have to use the part repairt tool to much.
    I'm specialized in car photograpy and often have to remove dust from the cars paint work and chrome. When I have to work on hughe areas Lightroom becomes slower and slower. I read that the repair tool costs a lot of performance but I'm wondering if I could optimize something or if there is a workaround for that? Because right now its not usable doing one click and waiting 2 minutes...
    I'm using the newest Lightroom 64-bit version on a Windows 8.1 Enterprise 64-bit Laptop with an internal SSD drive. LR is installed on that drive and the Catalogue also is stored there. I have 70 GB of free space on that drive, my catalogue is around 5 GB, my Camera Raw Cache Size is 20 GB.
    The machine has 16 GB of RAM and an Intel Core i7 3 GHz Quadcore processor. My RAW files are stored on an external USB 3.0 Drive (not SSD).
    When working on that kind of picutres I usually close as much programms as possible, so that most of the time LR is the only working desktop programm. What seems strange to me is, that even if I'm waiting for minutes for LR to answer, that my processor and RAM are only using about 40% of it's power. The rest seems not to be used by LR?!
    I would be really thankful for tipps or ideas how to improve that issue because right now I'm really wasting a lot of time.
    Kind regards
    Torsten

    I guess this depends on what you are doing, what type of original files you are using, and your own perception of quality. I would believe that in most cases, if you do all the editing in LR except for the spot removal, get the photo to appear the way you want (except for the spot removal), and then lastly move it to PSE and remove the spots, that there isn't really any noticeable loss of quality.
    I must admit I'm not a pro concerning color managment. But I already downloaded the PSE testversion and realized that it is not capable to deal with 16-bit color depth. Wouldn't that be noticeable after the finale spot removal step?
    So, you should tell Adobe this, not me. This is a forum for users (like me) to help other users (like you).
    I know. I just wanted to emphasize why switching to PS wouldn't be the perfect solution for me (even if I'm considering it).
    Thanks so far!

Maybe you are looking for

  • FB70_The entry 001 is missing in table TAB_FSKB

    Hi,     I create a company code, when I use FB70, enter company code、customer number、invoice and posting date, then click enter, a warning message will jump: The entry 001   is missing in table TAB_FSKB Message no. F5100     If I change the company c

  • MacBook 5,1 Fan Noise During Normal Operation

    Recently, my MacBook 5,1 with an Intel Core 2 Duo processor and 4GB of RAM has started making loud fan noises. The fan speed is steady at around 2,000 RPM (I belive this is normal), and the CPU temperature is staying around 60 degress celcius (also n

  • Report generation on Linux

    Platform: LabVIEW 8.6 on Fedora 10. Would I be correct in assuming that .doc and .xls format reports cannot be generated on Linux (I can't find anything in the few documents I have read, but it would be common sense to assume that) ? Does LabVIEW sup

  • Problem on date format for iso standard

    oracle 8.0.4e when i try to execute these script on oralce 8.0.4,i get different result. why? what shall i think about iso data standard? select to_char(to_date('2005/01/01','YYYY/MM/DD'),'YYYY/MM/DD') from dual; #2005/01/01 select to_char(to_date('2

  • DPM 2012 R2 failing on backup of BMR and System State

    We are running DPM 2012 R2 on Windows Server 2012 and I am trying to protect another Windows 2012 Server with a Bare Metal Recovery and system state but it fails on initial synchronization.  I get the following error in DPM: DPM failed to create the