Hello guys, I am Abhinav Ranjan.
I was creating one extension called GIF Creator.
But it showed me on error.
My code :
package com.niotron.creatorgif;
import javax.imageio.ImageIO;
import javax.imageio.stream.FileImageOutputStream;
import javax.imageio.stream.ImageOutputStream;
import java.awt.image.BufferedImage;
import java.io.File;
public class CreateGifExample {
public static void main(String[] args) throws Exception {
BufferedImage first = ImageIO.read(new File("/tmp/duke.jpg"));
ImageOutputStream output = new FileImageOutputStream(new File("/tmp/example.gif"));
GifSequenceWriter writer = new GifSequenceWriter(output, first.getType(), 250, true);
writer.writeToSequence(first);
File[] images = new File[]{
new File("/tmp/duke-image-watermarked.jpg"),
new File("/tmp/duke.jpg"),
new File("/tmp/duke-text-watermarked.jpg"),
};
for (File image : images) {
BufferedImage next = ImageIO.read(image);
writer.writeToSequence(next);
}
writer.close();
output.close();
}
}
Error shown :
Started Compiling Project GIFcreator
Buildfile: /compiler/android/build.xml
javac:
[mkdir] Created dir: /compiler/android/build/HwDui/classes
[javac] Compiling 1 source file to /compiler/android/build/HwDui/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] /compiler/android/src/HwDui/com/niotron/creatorgif/GIFcreator.java:9: error: class CreateGifExample is public, should be declared in a file named CreateGifExample.java
[javac] public class CreateGifExample {
[javac] ^
[javac] /compiler/android/src/HwDui/com/niotron/creatorgif/GIFcreator.java:15: error: cannot find symbol
[javac] GifSequenceWriter writer = new GifSequenceWriter(output, first.getType(), 250, true);
[javac] ^
[javac] symbol: class GifSequenceWriter
[javac] location: class CreateGifExample
[javac] /compiler/android/src/HwDui/com/niotron/creatorgif/GIFcreator.java:15: error: cannot find symbol
[javac] GifSequenceWriter writer = new GifSequenceWriter(output, first.getType(), 250, true);
[javac] ^
[javac] symbol: class GifSequenceWriter
[javac] location: class CreateGifExample
[javac] 3 errors
[javac] 1 warning