@Test void testLoadImagesFromGif() { }
public static SDImage[] loadImagesFromGif(String pathToGif) throws IOException { try { String[] imageatt = new String[] { "imageLeftPosition", "imageTopPosition", "imageWidth", "imageHeight" }; ImageReader reader = ImageIO.getImageReadersByFormatName("gif").next(); ImageInputStream ciis = ImageIO.createImageInputStream(new File(pathToGif)); reader.setInput(ciis, false); int noi = reader.getNumImages(true); BufferedImage master = null; SDImage[] images = new SDImage[noi]; for (int i = 0; i < noi; i++) { BufferedImage image = reader.read(i); IIOMetadata metadata = reader.getImageMetadata(i); Node tree = metadata.getAsTree("javax_imageio_gif_image_1.0"); NodeList children = tree.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { Node nodeItem = children.item(j); if (nodeItem.getNodeName().equals("ImageDescriptor")) { Map<String, Integer> imageAttr = new HashMap<>(); for (int k = 0; k < imageatt.length; k++) { NamedNodeMap attr = nodeItem.getAttributes(); Node attnode = attr.getNamedItem(imageatt[k]); imageAttr.put(imageatt[k], Integer.valueOf(attnode.getNodeValue())); } if (i == 0) { master = new BufferedImage(imageAttr.get("imageWidth"), imageAttr.get("imageHeight"), BufferedImage.TYPE_INT_ARGB); } master.getGraphics().drawImage(image, imageAttr.get("imageLeftPosition"), imageAttr.get("imageTopPosition"), null); } } SDImage imgData = convertImage(master); images[i] = imgData; } return images; } catch (IOException e) { logger.error("Error loeading gif", e); throw e; } }
IconHelper { public static SDImage[] loadImagesFromGif(String pathToGif) throws IOException { try { String[] imageatt = new String[] { "imageLeftPosition", "imageTopPosition", "imageWidth", "imageHeight" }; ImageReader reader = ImageIO.getImageReadersByFormatName("gif").next(); ImageInputStream ciis = ImageIO.createImageInputStream(new File(pathToGif)); reader.setInput(ciis, false); int noi = reader.getNumImages(true); BufferedImage master = null; SDImage[] images = new SDImage[noi]; for (int i = 0; i < noi; i++) { BufferedImage image = reader.read(i); IIOMetadata metadata = reader.getImageMetadata(i); Node tree = metadata.getAsTree("javax_imageio_gif_image_1.0"); NodeList children = tree.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { Node nodeItem = children.item(j); if (nodeItem.getNodeName().equals("ImageDescriptor")) { Map<String, Integer> imageAttr = new HashMap<>(); for (int k = 0; k < imageatt.length; k++) { NamedNodeMap attr = nodeItem.getAttributes(); Node attnode = attr.getNamedItem(imageatt[k]); imageAttr.put(imageatt[k], Integer.valueOf(attnode.getNodeValue())); } if (i == 0) { master = new BufferedImage(imageAttr.get("imageWidth"), imageAttr.get("imageHeight"), BufferedImage.TYPE_INT_ARGB); } master.getGraphics().drawImage(image, imageAttr.get("imageLeftPosition"), imageAttr.get("imageTopPosition"), null); } } SDImage imgData = convertImage(master); images[i] = imgData; } return images; } catch (IOException e) { logger.error("Error loeading gif", e); throw e; } } }
IconHelper { public static SDImage[] loadImagesFromGif(String pathToGif) throws IOException { try { String[] imageatt = new String[] { "imageLeftPosition", "imageTopPosition", "imageWidth", "imageHeight" }; ImageReader reader = ImageIO.getImageReadersByFormatName("gif").next(); ImageInputStream ciis = ImageIO.createImageInputStream(new File(pathToGif)); reader.setInput(ciis, false); int noi = reader.getNumImages(true); BufferedImage master = null; SDImage[] images = new SDImage[noi]; for (int i = 0; i < noi; i++) { BufferedImage image = reader.read(i); IIOMetadata metadata = reader.getImageMetadata(i); Node tree = metadata.getAsTree("javax_imageio_gif_image_1.0"); NodeList children = tree.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { Node nodeItem = children.item(j); if (nodeItem.getNodeName().equals("ImageDescriptor")) { Map<String, Integer> imageAttr = new HashMap<>(); for (int k = 0; k < imageatt.length; k++) { NamedNodeMap attr = nodeItem.getAttributes(); Node attnode = attr.getNamedItem(imageatt[k]); imageAttr.put(imageatt[k], Integer.valueOf(attnode.getNodeValue())); } if (i == 0) { master = new BufferedImage(imageAttr.get("imageWidth"), imageAttr.get("imageHeight"), BufferedImage.TYPE_INT_ARGB); } master.getGraphics().drawImage(image, imageAttr.get("imageLeftPosition"), imageAttr.get("imageTopPosition"), null); } } SDImage imgData = convertImage(master); images[i] = imgData; } return images; } catch (IOException e) { logger.error("Error loeading gif", e); throw e; } } private  IconHelper(); }
IconHelper { public static SDImage[] loadImagesFromGif(String pathToGif) throws IOException { try { String[] imageatt = new String[] { "imageLeftPosition", "imageTopPosition", "imageWidth", "imageHeight" }; ImageReader reader = ImageIO.getImageReadersByFormatName("gif").next(); ImageInputStream ciis = ImageIO.createImageInputStream(new File(pathToGif)); reader.setInput(ciis, false); int noi = reader.getNumImages(true); BufferedImage master = null; SDImage[] images = new SDImage[noi]; for (int i = 0; i < noi; i++) { BufferedImage image = reader.read(i); IIOMetadata metadata = reader.getImageMetadata(i); Node tree = metadata.getAsTree("javax_imageio_gif_image_1.0"); NodeList children = tree.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { Node nodeItem = children.item(j); if (nodeItem.getNodeName().equals("ImageDescriptor")) { Map<String, Integer> imageAttr = new HashMap<>(); for (int k = 0; k < imageatt.length; k++) { NamedNodeMap attr = nodeItem.getAttributes(); Node attnode = attr.getNamedItem(imageatt[k]); imageAttr.put(imageatt[k], Integer.valueOf(attnode.getNodeValue())); } if (i == 0) { master = new BufferedImage(imageAttr.get("imageWidth"), imageAttr.get("imageHeight"), BufferedImage.TYPE_INT_ARGB); } master.getGraphics().drawImage(image, imageAttr.get("imageLeftPosition"), imageAttr.get("imageTopPosition"), null); } } SDImage imgData = convertImage(master); images[i] = imgData; } return images; } catch (IOException e) { logger.error("Error loeading gif", e); throw e; } } private  IconHelper(); static int getTextBoxAlphaValue(); static void setTextBoxAlphaValue(int textBoxAlphaValue); static int getRollingTextPadding(); static void setRollingTextPadding(int rollingTextPadding); static SDImage createFolderImage(Color background, boolean applyFrame, Color frameColor); static SDImage createColoredFrame(Color borderColor); static void applyAlpha(BufferedImage image, BufferedImage mask); static SDImage addText(SDImage imgData, String text, int pos); static SDImage addText(BufferedImage imgData, String text, int pos); static SDImage addText(SDImage imgData, String text, int pos, float fontSize); static SDImage addText(BufferedImage imgData, String text, int pos, float fontSize); static AnimationStack createRollingTextAnimation(SDImage imgData, String text, int pos); static AnimationStack createRollingTextAnimation(SDImage imgData, String text, int pos, float fontSize); static SDImage cacheImage(String path, BufferedImage img); static SDImage convertImage(BufferedImage img); static SDImage convertImageAndApplyFrame(BufferedImage src, Color frameColor); static SDImage applyImage(SDImage imgData, BufferedImage apply); static BufferedImage applyFrame(BufferedImage img, Color frameColor); static void createIconPackage(String pathToArchive, String pathToIcon, String pathToGif,
			AnimationStack stack); static void createIconPackage(String pathToArchive, String pathToIcon, String[] pathToFrames,
			AnimationStack stack); static BufferedImage createResizedCopy(BufferedImage originalImage, boolean preserveType); static BufferedImage fillBackground(BufferedImage img, Color color); static BufferedImage flipHoriz(BufferedImage image); static SDImage getImage(String string); static BufferedImage getImageFromResource(String fileName); static IconPackage loadIconPackage(String pathToZip); static SDImage loadImageSafe(String path); static SDImage loadImageSafe(Path path); static SDImage loadImageSafe(String path, boolean applyFrame, Color frameColor); static SDImage loadImageSafe(Path path, boolean applyFrame, Color frameColor); static SDImage loadImage(Path path); static SDImage loadImage(String path); static SDImage loadImage(Path path, boolean applyFrame, Color frameColor); static SDImage loadImage(String path, boolean applyFrame, Color frameColor); static SDImage loadImage(String path, InputStream inputStream, boolean disableCache, boolean applyFrame, Color frameColor); static BufferedImage loadRawImage(Path path); static BufferedImage loadRawImage(InputStream inputStream); static SDImage loadImageFromResource(String path); static SDImage loadImageFromResourceSafe(String path); static SDImage[] loadImagesFromGif(String pathToGif); static BufferedImage rotate180(BufferedImage inputImage); }
IconHelper { public static SDImage[] loadImagesFromGif(String pathToGif) throws IOException { try { String[] imageatt = new String[] { "imageLeftPosition", "imageTopPosition", "imageWidth", "imageHeight" }; ImageReader reader = ImageIO.getImageReadersByFormatName("gif").next(); ImageInputStream ciis = ImageIO.createImageInputStream(new File(pathToGif)); reader.setInput(ciis, false); int noi = reader.getNumImages(true); BufferedImage master = null; SDImage[] images = new SDImage[noi]; for (int i = 0; i < noi; i++) { BufferedImage image = reader.read(i); IIOMetadata metadata = reader.getImageMetadata(i); Node tree = metadata.getAsTree("javax_imageio_gif_image_1.0"); NodeList children = tree.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { Node nodeItem = children.item(j); if (nodeItem.getNodeName().equals("ImageDescriptor")) { Map<String, Integer> imageAttr = new HashMap<>(); for (int k = 0; k < imageatt.length; k++) { NamedNodeMap attr = nodeItem.getAttributes(); Node attnode = attr.getNamedItem(imageatt[k]); imageAttr.put(imageatt[k], Integer.valueOf(attnode.getNodeValue())); } if (i == 0) { master = new BufferedImage(imageAttr.get("imageWidth"), imageAttr.get("imageHeight"), BufferedImage.TYPE_INT_ARGB); } master.getGraphics().drawImage(image, imageAttr.get("imageLeftPosition"), imageAttr.get("imageTopPosition"), null); } } SDImage imgData = convertImage(master); images[i] = imgData; } return images; } catch (IOException e) { logger.error("Error loeading gif", e); throw e; } } private  IconHelper(); static int getTextBoxAlphaValue(); static void setTextBoxAlphaValue(int textBoxAlphaValue); static int getRollingTextPadding(); static void setRollingTextPadding(int rollingTextPadding); static SDImage createFolderImage(Color background, boolean applyFrame, Color frameColor); static SDImage createColoredFrame(Color borderColor); static void applyAlpha(BufferedImage image, BufferedImage mask); static SDImage addText(SDImage imgData, String text, int pos); static SDImage addText(BufferedImage imgData, String text, int pos); static SDImage addText(SDImage imgData, String text, int pos, float fontSize); static SDImage addText(BufferedImage imgData, String text, int pos, float fontSize); static AnimationStack createRollingTextAnimation(SDImage imgData, String text, int pos); static AnimationStack createRollingTextAnimation(SDImage imgData, String text, int pos, float fontSize); static SDImage cacheImage(String path, BufferedImage img); static SDImage convertImage(BufferedImage img); static SDImage convertImageAndApplyFrame(BufferedImage src, Color frameColor); static SDImage applyImage(SDImage imgData, BufferedImage apply); static BufferedImage applyFrame(BufferedImage img, Color frameColor); static void createIconPackage(String pathToArchive, String pathToIcon, String pathToGif,
			AnimationStack stack); static void createIconPackage(String pathToArchive, String pathToIcon, String[] pathToFrames,
			AnimationStack stack); static BufferedImage createResizedCopy(BufferedImage originalImage, boolean preserveType); static BufferedImage fillBackground(BufferedImage img, Color color); static BufferedImage flipHoriz(BufferedImage image); static SDImage getImage(String string); static BufferedImage getImageFromResource(String fileName); static IconPackage loadIconPackage(String pathToZip); static SDImage loadImageSafe(String path); static SDImage loadImageSafe(Path path); static SDImage loadImageSafe(String path, boolean applyFrame, Color frameColor); static SDImage loadImageSafe(Path path, boolean applyFrame, Color frameColor); static SDImage loadImage(Path path); static SDImage loadImage(String path); static SDImage loadImage(Path path, boolean applyFrame, Color frameColor); static SDImage loadImage(String path, boolean applyFrame, Color frameColor); static SDImage loadImage(String path, InputStream inputStream, boolean disableCache, boolean applyFrame, Color frameColor); static BufferedImage loadRawImage(Path path); static BufferedImage loadRawImage(InputStream inputStream); static SDImage loadImageFromResource(String path); static SDImage loadImageFromResourceSafe(String path); static SDImage[] loadImagesFromGif(String pathToGif); static BufferedImage rotate180(BufferedImage inputImage); static final String TEMP_BLACK_ICON; static final BufferedImage FRAME; static final Font DEFAULT_FONT; static final int TEXT_TOP; static final int TEXT_CENTER; static final int TEXT_BOTTOM; static final SDImage BLACK_ICON; static final SDImage FOLDER_ICON; }