We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public class Avatars { public static final Avatar AVATAR = GitHubAvatar.newAvatarBuilder() .build(); public static File getAvatarFile(long code) { return getFile(Avatars.AVATAR, code); } private static File getFile(Avatar avatar, long code) { int size = avatar.getWidth(); BufferedImage dest = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = dest.createGraphics(); AvatarUtils.activeAntialiasing(g2); g2.drawImage(avatar.create(code), 0, 0, size, size, null); g2.dispose(); return toFile(dest); } private static File toFile(BufferedImage bi) { Path file; try { file = Files.createTempFile("img", ".png"); ImageIO.write(bi, "png", file.toFile()); return file.toFile(); } catch (IOException e) { throw new RuntimeException(e); } } public static void main(String[] args) throws IOException { final File avatarFile = getAvatarFile(0L); Desktop.getDesktop().open(avatarFile); } }
Exception in thread "main" com.talanlabs.avatargenerator.AvatarException: Failed to build avatar at com.talanlabs.avatargenerator.Avatar.buildAll(Avatar.java:128) at com.talanlabs.avatargenerator.Avatar.create(Avatar.java:71) at in.hocg.eagle.basic.lang.Avatars.getFile(Avatars.java:34) at in.hocg.eagle.basic.lang.Avatars.getAvatarFile(Avatars.java:26) at in.hocg.eagle.basic.lang.Avatars.main(Avatars.java:51) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 6 at java.lang.String.substring(String.java:1963) at com.talanlabs.avatargenerator.utils.AvatarUtils.extractColor(AvatarUtils.java:196) at com.talanlabs.avatargenerator.element.GitHubElementRegistry.buildImage(GitHubElementRegistry.java:32) at com.talanlabs.avatargenerator.element.AbstractImageElementRegistry.getElement(AbstractImageElementRegistry.java:21) at com.talanlabs.avatargenerator.Avatar.buildAvatarImage(Avatar.java:150) at com.talanlabs.avatargenerator.Avatar.buildAll(Avatar.java:108) ... 4 more
The text was updated successfully, but these errors were encountered:
Hi, addZeroes must be corrected
Sorry, something went wrong.
No branches or pull requests
This Code
This Exception
The text was updated successfully, but these errors were encountered: