Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting tif to jpeg

807591Jun 3 2008 — edited Jun 3 2008
Hi

I'm trying to convert a tif file to a jpeg file with jimi, but i get only a black jpeg as result.
My code looks like this;
import java.awt.Image;
import java.io.File;
import java.io.IOException;
 
import com.sun.jimi.core.Jimi;
import com.sun.jimi.core.JimiException;
 
public class TiffConverter {
 
    /**
     * @param args
     */
    public static void main(String[] args) {
        
      File tifFile = new File("test.tif");
      File jpgFile = new File("test.jpg");
      ConvTif2Jpg(jpgFile, tifFile);
    }
    
    /**
     * Convert
     * @param jpgF
     * @param tifF
     */
    public static void ConvTif2Jpg(File jpgF, File tifF){
    	
        Image image = Jimi.getImage(tifF.getAbsolutePath());
        
        try {
        	
            Jimi.putImage(image, jpgF.getAbsolutePath());
            
        } catch (JimiException ex) {
        	
            ex.printStackTrace();
        }     
    }
}
anyone know why i get only a black jpeg ? is there an other way to transform the tif ?

thanks a lot !!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 1 2008
Added on Jun 3 2008
1 comment
93 views