From 87eb964a136a87014d75804acdd62e3b0f5291be Mon Sep 17 00:00:00 2001 From: landaiqing <3517283258@qq.com> Date: Thu, 6 Jun 2024 17:34:21 +0800 Subject: [PATCH] feat: update --- .../auth/application/controller/Test.java | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 schisandra-cloud-storage-auth/schisandra-cloud-storage-auth-application/schisandra-cloud-storage-auth-application-controller/src/main/java/com/schisandra/auth/application/controller/Test.java diff --git a/schisandra-cloud-storage-auth/schisandra-cloud-storage-auth-application/schisandra-cloud-storage-auth-application-controller/src/main/java/com/schisandra/auth/application/controller/Test.java b/schisandra-cloud-storage-auth/schisandra-cloud-storage-auth-application/schisandra-cloud-storage-auth-application-controller/src/main/java/com/schisandra/auth/application/controller/Test.java deleted file mode 100644 index 984710f..0000000 --- a/schisandra-cloud-storage-auth/schisandra-cloud-storage-auth-application/schisandra-cloud-storage-auth-application-controller/src/main/java/com/schisandra/auth/application/controller/Test.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.schisandra.auth.application.controller; - -import com.schisandra.auth.common.utils.RotateImageUtils; -import net.coobird.thumbnailator.Thumbnails; - -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.InputStream; -import java.security.SecureRandom; - -/** - * @Classname Test - * @BelongsProject: schisandra-cloud-storage - * @BelongsPackage: com.schisandra.auth.application.controller - * @Author: landaiqing - * @CreateTime: 2024-06-06 12:07 - * @Description: TODO - * @Version: 1.0 - */ -public class Test { - public static void main(String[] args){ - InputStream inputStream = ReactRotateCaptchaController.class.getClassLoader().getResourceAsStream("image/13000.png"); - SecureRandom random = new SecureRandom(); - double randomNumber = random.nextInt(280) + 40; - BufferedImage bufferedImage = null; - try { - bufferedImage = Thumbnails.of(inputStream).size(1280,1024).rotate(randomNumber).asBufferedImage(); - } catch (IOException e) { - throw new RuntimeException(e); - } - - BufferedImage newCompleteImage = new BufferedImage(bufferedImage.getWidth(), bufferedImage.getHeight(), - BufferedImage.TYPE_INT_ARGB); - newCompleteImage.createGraphics().drawImage(bufferedImage, 0, 0, null); - String img = null; - try { - img = RotateImageUtils.BufferedImageToBase64(newCompleteImage); - } catch (IOException e) { - throw new RuntimeException(e); - } - System.out.println(img); - - } - -}