When I was creating one extension GIF creator it showed a bug

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

I can’t see you adding any Annotation for making blocks and you are making class and not extending AndroidNonVisibleComponents, there is no constructor
Please learn extension development’s basics first

1 Like

Ok thanks.

You must check this video

On OP’s request the topic is closed