Jpeg encoding

Hi
I wondered if someone could help.
I am working on an app that allows people to manipulate
images and have them passed to the server to be sent or stored. I
have all the basics working here and the jpeg encoded data being
passed to the server etc. All works well.
However, my next hurdle is how to pass multiple encoded files
in what shot? As the user can say have 5 images that they can make
in one session, to create a simple animation. Is there a way of
packaging multiple bytearrays up and for php to sort them out on
the server?
I avent had much experience with byte arrays so any pointers
would be great.
regards
ade

the jdk library is open source. did you look for the jpeg encoder?
package com.sun.image.codec.jpeg

Similar Messages

  • Problems when jpeg encoding multiple images

    Hi, im trying to write a servlet which generates multiple thumbs. However when encoding for the second time i get an error java.io.IOException: reading encoded JPEG Stream.
    I can't figure out the problem
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.awt.Image;
    import java.awt.Graphics2D;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import javax.swing.ImageIcon;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    public class Thumbs extends HttpServlet {
      private String dbDriver = "com.mysql.jdbc.Driver";
      private String dbURL = "jdbc:mysql://localhost/shopper?";
      private String userID = "javauser";
      private String passwd = "javadude";
      private Connection dbConnection;
      //Initialize global variables
      public void init() throws ServletException {
      //Process the HTTP Get request
      public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        try{
          String foreignNr = request.getParameterValues("p")[0];
          String maxDim = request.getParameterValues("s")[0];
          if (foreignNr != null){
            int foreignID = Integer.parseInt(foreignNr);
            int maxDimension = Integer.parseInt(maxDim);
            response.setContentType("image/jpeg");
            OutputStream out = response.getOutputStream();
            writeThumbnailPictures(out,foreignID,maxDimension);
        } catch (Exception ex){
            log(ex.getMessage());
      public void writeThumbnailPictures(OutputStream out,int foreignID,int maxDimension){
        try{
          Class.forName(dbDriver);
          dbConnection = DriverManager.getConnection(dbURL, userID, passwd);
          PreparedStatement pageStatement;
          pageStatement = dbConnection.prepareStatement(
              "select * from pictures where ForeignID = ?");
          pageStatement.setInt(1, foreignID);
          ResultSet recs = pageStatement.executeQuery();
          while (recs.next()) {
            byte[] data = recs.getBytes("Picture");
            if (data != null) {
              Image inImage = new ImageIcon(data).getImage();
              // Determine the scale.
               double scale = (double)maxDimension / (double)inImage.getHeight(null);
               if (inImage.getWidth(null) > inImage.getHeight(null)) {
                   scale = (double)maxDimension /(double)inImage.getWidth(null);
               // Determine size of new image.
               // One of them should equal maxDim.
               int scaledW = (int)(scale*inImage.getWidth(null));
               int scaledH = (int)(scale*inImage.getHeight(null));
               // Create an image buffer in
               //which to paint on.
               BufferedImage outImage = new BufferedImage(scaledW, scaledH,
                   BufferedImage.TYPE_INT_RGB);
               // Set the scale.
               AffineTransform tx = new AffineTransform();
               // If the image is smaller than
               // the desired image size,
               // don't bother scaling.
               if (scale < 1.0d) {
                   tx.scale(scale, scale);
               // Paint image.
               Graphics2D g2d = outImage.createGraphics();
               g2d.drawImage(inImage, tx, null);
               g2d.dispose();
               // JPEG-encode the image
               JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
               encoder.encode(outImage);
          out.close();
        catch(Exception ex){
          ex.printStackTrace();
      //Clean up resources
      public void destroy() {
    }

    Hi,
    I am facing same problem while generating the thumbs. Did you figure out what the problem is? if you have the solution, do post it.
    Thanks in advance
    Mo

  • Problems with JPEG encoding

    I'm making photo album on the web. But I have a problem with thumbnails generation. I have read alot about it on this forum (thanks guys) but I have a problem:
    Sometimes (but not every time) and independent on the image I've got thumbnail picture that can not be readed neither by IE or Photoshop or another programm. I'm using next encoding sequence:
    PEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    com.sun.image.codec.jpeg.JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bufferedImage);
    writeParam.setCompressionMode(JPEGImageWriteParam.MODE_EXPLICIT);
    param.setQuality(0.7f, true);
    encoder.setJPEGEncodeParam(param);
    encoder.encode(bufferedImage);
    And this code operate in the Servlet enviroment. So, I can not understand what is wrong?
    Renat.

    Hi Renat.
    I may be wrong but I have observed some troubles with JPEG encoding (particularly because of a lack of CPU)... You may have the same trouble... The problem is that I don't how to catch these errors but if someone knows how to, I would be really interested in... I can only catch them when I decode these images thanks to TruncatedFileException and ImageFormatException.
    Stephane.

  • Jpeg Encoding Problem

    Hello,
    I have an applet that reads a data file and plots a graph. Now i'm having problem converting the graph into a jpg file using a jpeg encoder.
    I have the following snippet of code in the end.
    File file = new File("c:\\vj\\graph.jpg");
         if (file.exists()) {file.delete();}
         try {file.createNewFile();} catch (IOException eIo) {}
         try
         OutputStream out = new FileOutputStream( file );
         Image image = (Image)chart2D.createImage(chart2D.getWidth() ,chart2D.getHeight());
         Graphics g = image.getGraphics();
         chart2D.paint(g);
         BufferedImage bufImage = (BufferedImage)image;
    //     JPEGEncodeParam jep = new JPEGEncodeParam();
         JPEGImageEncoder jencoder = JPEGCodec.createJPEGEncoder(out);
         jencoder.encode(bufImage);
         out.flush();
         out.close();
         } catch (IOException e) {}
    But when i run the applet it gives me a security exception saying:
    java.security.AccessControlException: access denied (java.io.FilePermission c:\vj\graph.jpg read)
    How do i fix this problem??
    Any help would be appreciated,
    Thanks,
    Mamtha.

    Unfortunately, you can't do file I/O from an applet unless it is a signed applet. See applet security FAQ:
    http://java.sun.com/sfaq/
    If it's at all feasible, by far the simplest solution is to add a min method and make it an application instead of an applet. If it must be an applet, things get a little more complicated! Here are a couple of possibilities:
    1) You could sign your applet. For an example, see:
    http://java.sun.com/security/signExample/
    2) You can send the file to the server where the applet came from, and then have the server write it to disk. Finally, the client can request the file from the server. For an explanation and example code, see:
    http://java.sun.com/docs/books/tutorial/applet/practical/workaround.html

  • Info abt  jpeg Encoder

    hi
    i'm doing some image processing and i want to save tht processed image in mobile memory.I think to retrieve the processed image after storing needs some encoding format is there any jpeg encoder available or else v've have write our own encoder.
    and also is it possible to change the encoder in core java to j2me
    thanx in advance

    Hi nitin
    Manual accurals - you can post accurals manually in two scenarios when you are going to pay for lumpsum amount and when you are going for accurals correction
    when you enter the amount manually in VBo2 then a credit memo request is created . but these are not posted to FI as these are manual accurals and manual payments
    Manual payments - When you click on the payment data tab in VBo2 then you can  enter the value and the accural amount partially or fully and when you save a credit memo request is created . then you can do the billing and that accural amount is passed to FI
    Regards
    Srinath

  • JPEG ENCODING AND DECODİNG WITH DCT TRANSFORMATION

    I NEED A JAVA SOURCE CODE JPEG ENCODING AND DECOD&#304;NG WITH DCT TRANSFORMATION ALSO QUANTIZATION. IT IS URGENT BECAUSE I WILL USE IT IN MY PROJECT AND I AM NOT GOOD AT JAVA . PLEASE I AM WAITING YOUR HELPS. MY MAIL IS [email protected] thank you very much

    I NEED A JAVA SOURCE CODE JPEG ENCODING AND DECOD�NG WITH DCT TRANSFORMATION ALSO QUANTIZATION. IT IS URGENT BECAUSE I WILL USE IT IN MY PROJECT AND I AM NOT GOOD AT JAVA . PLEASE I AM WAITING YOUR HELPS. MY MAIL IS [email protected] thank you very much

  • Jpeg encoding in headless environment PLEASE HELP

    Hello, thank you so much for anyone that might be able to help me. If I am in the wrong forum, sorry.. please tell me where I need to go (I'm new here).
    I am running a servlet (tomcat 4.01 - JRE 1.4.1) that uploads jpg images and creates thumbnails from them in a headless environment. The images are created without a problem for some amount of time and then all the images created are black (but they are the correct size). I haven't figured out what the trigger is yet. The memory seems to be ok (5 - 20MB left depending on how big the upload is). The only think I can do to make the process work correctly again is to restart the server. I have written out the image to a file before converting it and the image uploads fine... just the resized thumbnail is black. I have seen other issues like this which say to use a MediaTracker but I have 2 questions about that:
    1) I don't have a component to use for the MediaTracker because I get a HeadlessException
    2) I save the uploaded content into a byte array before converting so, I should have it already, right?
    Below is the code I am using and any help would GREATLY appreciated. I thank anyone for taking the time to read this!
    import java.awt.Image;
    import java.awt.Graphics2D;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.FileOutputStream;
    import javax.swing.ImageIcon;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    // this is the image resizine method snippet
    public void resizeImage (int maxDim, byte[] imgContent, File outputFile) throws IOException {
         Image inImage = new ImageIcon(imgContent).getImage();
         int width = inImage.getWidth(null);
         int height = inImage.getHeight(null);
         double scale = maxDim / (double) height;
         if (width > height) scale = maxDim / (double) width;
         int scaledWidth = (int)(scale * width);
         int scaledHeight = (int)(scale * height);
         BufferedImage outImage = new BufferedImage(scaledWidth, scaledHeight, BufferedImage.TYPE_INT_RGB);
         AffineTransform tx = new AffineTransform();
         // If the image is smaller than
         //the desired image size,
         // don't bother scaling.
         if (scale < 1.0d) {
              tx.scale(scale, scale);
         // Paint image.
         Graphics2D g2d = outImage.createGraphics();
         g2d.drawImage(inImage, tx, null);
         g2d.dispose();
         // JPEG-encode the image
         //and write to file.
         FileOutputStream os = null;
         try {
              os = new FileOutputStream(outputFile);
              JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
              encoder.encode(outImage);
         finally {
              os.close();
    }

    Hello, thank you so much for anyone that might be able to help me. If I am in the wrong forum, sorry.. please tell me where I need to go (I'm new here).
    I am running a servlet (tomcat 4.01 - JRE 1.4.1) that uploads jpg images and creates thumbnails from them in a headless environment. The images are created without a problem for some amount of time and then all the images created are black (but they are the correct size). I haven't figured out what the trigger is yet. The memory seems to be ok (5 - 20MB left depending on how big the upload is). The only think I can do to make the process work correctly again is to restart the server. I have written out the image to a file before converting it and the image uploads fine... just the resized thumbnail is black. I have seen other issues like this which say to use a MediaTracker but I have 2 questions about that:
    1) I don't have a component to use for the MediaTracker because I get a HeadlessException
    2) I save the uploaded content into a byte array before converting so, I should have it already, right?
    Below is the code I am using and any help would GREATLY appreciated. I thank anyone for taking the time to read this!
    import java.awt.Image;
    import java.awt.Graphics2D;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.FileOutputStream;
    import javax.swing.ImageIcon;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    // this is the image resizine method snippet
    public void resizeImage (int maxDim, byte[] imgContent, File outputFile) throws IOException {
         Image inImage = new ImageIcon(imgContent).getImage();
         int width = inImage.getWidth(null);
         int height = inImage.getHeight(null);
         double scale = maxDim / (double) height;
         if (width > height) scale = maxDim / (double) width;
         int scaledWidth = (int)(scale * width);
         int scaledHeight = (int)(scale * height);
         BufferedImage outImage = new BufferedImage(scaledWidth, scaledHeight, BufferedImage.TYPE_INT_RGB);
         AffineTransform tx = new AffineTransform();
         // If the image is smaller than
         //the desired image size,
         // don't bother scaling.
         if (scale < 1.0d) {
              tx.scale(scale, scale);
         // Paint image.
         Graphics2D g2d = outImage.createGraphics();
         g2d.drawImage(inImage, tx, null);
         g2d.dispose();
         // JPEG-encode the image
         //and write to file.
         FileOutputStream os = null;
         try {
              os = new FileOutputStream(outputFile);
              JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
              encoder.encode(outImage);
         finally {
              os.close();
    }

  • Is there a JPEG encoder for j2me, PNG,GIF and BMP encoders are also wanted.

    As is known that, image encoders are not currently available in MIDP. I have tried to port a j2se JPEG encoder to J2ME, but it cost me 32M memory when generating a 800x600 image. Could anyone help me. Thanks

    well, of course ... what did you expect?Hum, I want to do some processing on my pictures, such as rotation, and then save it or send to my friends via MMS. but it's not easy to save the processed pixels to image file, such as JPEG, GIF or PNG.

  • ImageSnapShot and Alchemy Jpeg encoder

    Hi!
    I was trying to figure out how can i use the Alchemy JPEG encoder with ImageSnapShot to capture image and encode with Alchemy encoder
    If you see the ImageSnapShot function to capture is:
         var jpg : JPEGEncoder = new JPEGEncoder();
         var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(image, 0, jpg);
    I want to capture a BIG screen, using JPEGEncoder its impossible beacose times of encoding.
    So, some can anyone that had worked with this tell me if its possible?
    Thanks in advance
    And excuse about my english =)

    I have just put up a tutorial/guide on how to use the Alchemy JPEG encoder in Flash. It's also an example on how to use a progressbar to monitor the encoding. Check out http://last.instinct.se/graphics-and-effects/using-the-fast-asynchronous-alchemy-jpeg-enco der-in-flash/640

  • JPEG Encoder to GIF

    Hi I have this code, it works great except it creates JPEG's and I want to create GIFS...anyone know how????
    Cheers
        try {file.createNewFile();} catch (IOException e2) {}
        try
          OutputStream out = new FileOutputStream( file );
          Image image = s.getImage();
          BufferedImage bufImage = (BufferedImage)image;
          JPEGImageEncoder jencoder = JPEGCodec.createJPEGEncoder(out);
          jencoder.encode(bufImage);
          out.flush();
          out.close();
        catch(Exception e)
        }

    ImageIO.write( image, "gif" );
    or
    use PNGs instead.

  • JPEG encoder quality problem

    my static method is as follow: (copy from here, and i and a setQuality Method)
    public class JPEGHandler
         public static void saveJPG(BufferedImage bi,float q,String pathname){
              String s = null;
              //BufferedImage bi = createBufferedImage(img);
              FileOutputStream out = null;
              try     {
                   File file = new File(pathname);
                   s = file.getName();
                   out = new FileOutputStream(file);
              catch (java.io.FileNotFoundException io){
                   System.out.println("File Not Found");
              catch (java.io.IOException e){
                   System.err.println(e);
                   JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
                   JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bi);
                   param.setQuality(q, true); //Set the quality
              try {
                   encoder.encode(bi);
              catch (java.io.IOException io)
                   System.out.println("IOException");
              try{
                   out.close();
              catch (java.io.IOException io){
                   System.out.println("IOException");
              System.out.println("JPEG Saved: " + s);
    no matter i assign 0.5 or 1 to the setQuality method, the quailty and the file size of the jpg remain unchange.
    also, i have tried to set the second param of setQuailty to true and false, it dosn't help at all !!
    Anyone know how to solve it ?

    try{
         ByteArrayInputStream in=new ByteArrayInputStream(image_data);
         JPEGImageDecoder decoder =JPEGCodec.createJPEGDecoder(in,params);
         image = decoder.decodeAsBufferedImage();
         in.close();
         }catch (Exception e) {
         System.err.println("Exception "+e + " decoding "+image_name+" as JPEG");
    I've just been playing with Java 1.4 (which includes updates Graphics2D) and it fixes a number or errors I had with 1.3
    MArk

  • Jpeg encoding with imageio - pink distortion problem

    Hello, I am using the imageio classes to scale down jpg images (for thumbnails) and write them to a file. On most images, everything works perfectly. On some images, however, the resulting thumbnail image has a strange pink coloration to the whole picture. Does anyone have any ideas as to why this would happen? The code I am using is below. I thank anyone that takes the time to read this and hope someone can help.
    import java.awt.Graphics2D;
    import java.awt.geom.AffineTransform;
    import java.awt.image.AffineTransformOp;
    import java.awt.image.BufferedImage;
    import java.awt.image.IndexColorModel;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import javax.imageio.IIOImage;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageTypeSpecifier;
    import javax.imageio.ImageWriteParam;
    import javax.imageio.ImageWriter;
    import javax.imageio.plugins.jpeg.JPEGImageWriteParam;
    import javax.imageio.stream.ImageOutputStream;
    public class ImageResizer
         private static final int THUMBNAIL_MAX = 120;
         private static final int SMALL_MAX = 250;
         private static final int LARGE_MAX = 575;
         private static final int LARGE_THRESHOLD = 425;
         BufferedImage inImage;
         int width;
         int height;
         private static JPEGImageWriteParam params;
         static {
              JPEGImageWriteParam params = new JPEGImageWriteParam(null);
              params.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
              params.setCompressionQuality(0.8f);
              params.setProgressiveMode(ImageWriteParam.MODE_DISABLED);
              params.setDestinationType(
                   new ImageTypeSpecifier(IndexColorModel.getRGBdefault(),
                   IndexColorModel.getRGBdefault().createCompatibleSampleModel(16,16)));
         public ImageResizer(byte[] image, long id) throws IOException
              inImage = ImageIO.read(new ByteArrayInputStream(image));
              width = inImage.getWidth(null);
              height = inImage.getHeight(null);
         public void makeSmallImage (File outputFile) throws IOException {
              resizeImage(120, outputFile);
         private void resizeImage (int maxDim, File file) throws IOException {
              double scale = maxDim / (double) height;
              if (width > height) scale = maxDim / (double) width;
              int scaledWidth = (int)(scale * width);
              int scaledHeight = (int)(scale * height);
              BufferedImage outImage = new BufferedImage(scaledWidth, scaledHeight, BufferedImage.TYPE_INT_RGB);
              AffineTransform xform = AffineTransform.getScaleInstance(scale, scale);
              AffineTransformOp op = new AffineTransformOp(xform, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
              // Paint image.
              Graphics2D g2d = outImage.createGraphics();
              g2d.drawImage(inImage, op, 0, 0);
              g2d.dispose();
              // write the image out
              ImageOutputStream ios = null;
              try {
                   ios = ImageIO.createImageOutputStream(file);
                   ImageWriter writer = (ImageWriter) ImageIO.getImageWritersByFormatName("jpg").next();
                   writer.setOutput(ios);
                   writer.write(null, new IIOImage(outImage, null, null), params);
                   writer.dispose();
              catch (IOException e) {
                   System.out.println("cought IOException while writing " +
                   file.getPath());
              finally {
                   if (null != ios) ios.close();
    }

    I am having the same problem with jpegs.
    The strange thing is that this only happends with the same exact code on OS X, while it never happens on any windows machine.
    I have tried using the the ImageIO classes, and a class I got off of this board a while back; however when using this class on an OS X machine, encoding takes a really long time and gives the pink distortion.
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.swing.*;
    import com.sun.image.codec.jpeg.*;
    import java.awt.event.*;
    import java.util.*;
    import java.awt.geom.*;
    public class ImageUtils {
         private static JPEGImageEncoder encoder = null;
         private static FileOutputStream fileStream = null;
         public static BufferedImage createComponentImage(Component component)
              BufferedImage image = (BufferedImage)component.createImage(component.getWidth(),component.getHeight());
              Graphics graphics = image.getGraphics();
              if(graphics != null) { component.paintAll(graphics); }
              return image;
         public static void encodeImage(BufferedImage image, File file) throws IOException
              fileStream = new FileOutputStream(file);
              JPEGEncodeParam encodeParam = JPEGCodec.getDefaultJPEGEncodeParam(image);
              encoder = JPEGCodec.createJPEGEncoder(fileStream);
              encoder.encode(image,encodeParam);
    }use it like this:
    File file = new File("ImageTest.jpg");
    image = ImageUtils.createComponentImage(imageCanvas);
    ImageUtils.encodeImage(image,file);

  • JPEG encoding-decoding of intensities

    Hi,
    I used the following code to create jpeg image from intensity values and to retrieve the intensity values by decoding the jpeg image. Everything works fine except that I got some intensity values which are negative. I don't know from where this negative intensities are coming from. Here is my code:
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    public class JpegEnDecoder{
    public static void main(String[] args) throws Throwable {
    int w = 200, h = 1;
              short[] OneDimImage = new short[w*h];
    for (int i=0;i<w*h;i++)
                   OneDimImage=(short)(32500+i);
              DataBuffer dbuf = new DataBufferUShort(OneDimImage, OneDimImage.length);
              int[] masks = {0xf800, 0x07e0, 0x001f};
    WritableRaster raster = Raster.createPackedRaster(dbuf, w, h, w, masks, null);
              ColorModel colorModel = new DirectColorModel(16, masks[0], masks[1], masks[2]);
    BufferedImage bi1 = new BufferedImage(colorModel, raster, false, null);
    File file = new File("test.jpeg");
    ImageIO.write(bi1, "jpeg", file);
              int type = bi1.getType();
              BufferedImage bi2 = convert(ImageIO.read(file), BufferedImage.TYPE_USHORT_565_RGB);
    WritableRaster raster1 = bi2.getRaster();
    DataBuffer db = raster1.getDataBuffer();
              DataBufferUShort dbi = (DataBufferUShort) db;
    short[] data = dbi.getData();
    for (int j=0;j<data.length;j++)
    System.out.println(data[j]);
    public static BufferedImage convert(BufferedImage source, int targetType) {
    int sourceType = source.getType();
    if (sourceType == targetType)
    return source;
    BufferedImage result = new BufferedImage(source.getWidth(), source.getHeight(), targetType);
    Graphics2D g = result.createGraphics();
    g.drawRenderedImage(source, null);
    g.dispose();
    return result;
    I will be pleased if anybody can explain how to solve this problem. Thanks in advance.

    {noformat}_Anti{noformat}, don't double post. If you want a thread moved to a more appropriate forum, make a request in the [_current RA thread_|http://forums.sun.com/thread.jspa?threadID=5414121] in the News and Updates forum.
    I've removed your other thread on the same topic.
    db

  • JPEG Encoder?

    Please refer to [2] of http://forum.java.sun.com/thread.jsp?forum=31&thread=515221&tstart=0&trange=15
    Add this to the list of links
    http://www.obrador.com/essentialjpeg/index.html
    Thanks.

    Don't start a new thread for this. If you need to add more information to your question, then just reply to your original thread. The forum is cluttered enough with duplicate posts.

  • 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

Maybe you are looking for

  • Itunes not reading id3 tags

    For some reason, many of my songs that I imported using previous versions of itunes *specifically version 10.5* no longer are reading the ID3 tags correctly and now come up as unknown artists, unknown albums.  Is there anyway to fix this without doin

  • Error when running Personal Glassfish v3

    When I try to deploy my server program with Personal Glassfish v3, I get this error: Mar 21, 2010 3:32:18 PM com.sun.enterprise.glassfish.bootstrap.ASMain main INFO: Launching GlassFish on Felix platform Welcome to Felix ================ Mar 21, 2010

  • MacBook Pro DVD Drive Bitsettings/Booktype

    I have a MacBook Pro with a 'MATSHITA DVD-R UJ-857D' DVD Drive and I am wanting to make changes to the Booktype when I burn a DVD. I have not been able to find a solution but below is a list of what I have tried: * Emulated Windows XP and tried makin

  • Sql Loader Data Import Error!!!

    Hi, I have to import a huge volume of records from a CSV(150MB) file to table using sql loader. The input file contains '3286909' records. I am using the following control file and command to run the sql loader. Control File: lload data infile Test.c

  • Budget check in p.o

    Dear experts, We have attached wbs in pm order & budget control by wbs.But in po budget not get checked despite of all configuration in ps .I want to know that whwthwr any integration in pm for this Please reply me. Vikas