Pessoal estou tentando compilar o codigo abaixo e nao estou conseguindo encontrar uma solução. Alguem poderia propor uma solução para o codigo?
Ja tentei de tudo e não consegui compilar, este codigo.
public static void main(String[] args) throws IOException
{
BufferedImage image = ImageIO.read(new File("100_9.JPG"));
JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(image);
int width = image.getWidth();
int height = image.getHeight();
int nbands = image.getSampleModel().getNumBands();
Raster inputRaster = image.getData();
int[] pixels = new int[nbands*width*height];
inputRaster.getPixels(0,0,width,height,pixels);
for(int h=0;h<height;h++)
for(int w=0;w<width;w++)
{
int offset = h*width*nbands+w*nbands;
System.out.print("at ("+w+","+h+"): ");
for(int band=0;band<nbands;band++)
System.out.print(pixels[offset+band]+" ");
}
}
Obrigado