Package club.zhcs.lina.utils
Class ImageUtils
java.lang.Object
org.nutz.img.Images
club.zhcs.lina.utils.ImageUtils
public class ImageUtils
extends org.nutz.img.Images
- Author:
- Kerbores(kerbores@riemann.tech)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.nutz.img.Images
CHANNEL_BLUE, CHANNEL_GREEN, CHANNEL_RED, WATERMARK_BOTTOM_CENTER, WATERMARK_BOTTOM_LEFT, WATERMARK_BOTTOM_RIGHT, WATERMARK_CENTER, WATERMARK_CENTER_LEFT, WATERMARK_CENTER_RIGHT, WATERMARK_TOP_CENTER, WATERMARK_TOP_LEFT, WATERMARK_TOP_RIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.nutz.lang.util.NutMapstatic FilegenerateImage(String imgStr, File outFile) static FilegenerateImage(String imgStr, File outDir, String suffix) 根据base64串生成文件static FilegeneratePngImage(String imgStr) 生成png图片static StringgetImageStr(File imgFile) 图片转换成base64串static FiletoFile(BufferedImage bfi) 将 BufferedImage 写入文件static BufferedImagezoomAndClip(File src, double scale, int xStart, int yStart, int xEnd, int yEnd) 图片缩放裁剪static BufferedImagezoomAndClip(File src, double scale, ImageUtils.Point start, int w, int h) static BufferedImagezoomAndClip(File src, double scale, ImageUtils.Point start, ImageUtils.Point end) Methods inherited from class org.nutz.img.Images
addWatermark, channelImage, clipScale, clipScale, clipScale, clipScale, clipScale, clipScale, createAvatar, createAvatar, createCaptcha, createCaptcha, createText, createText, cutoutByChannel, cutoutByLuminance, cutoutByPixel, encodeBase64, encodeBase64, flipHorizontal, flipHorizontal, flipVertical, flipVertical, grayImage, multiply, read, redraw, rotate, rotate, rotate, scale, twist, write, write, writeAndClose, writeJpeg, zoomScale, zoomScale, zoomScale, zoomScale
-
Constructor Details
-
ImageUtils
public ImageUtils()
-
-
Method Details
-
zoomAndClip
public static BufferedImage zoomAndClip(File src, double scale, int xStart, int yStart, int xEnd, int yEnd) throws IOException 图片缩放裁剪- Parameters:
src- 源图scale- 缩放比例xStart- 起点X坐标yStart- 起点Y坐标xEnd- 终点X坐标yEnd- 终点Y坐标- Returns:
- 目标图片
- Throws:
IOException- 当读写文件失败时抛出
-
zoomAndClip
public static BufferedImage zoomAndClip(File src, double scale, ImageUtils.Point start, ImageUtils.Point end) throws IOException - Throws:
IOException
-
toFile
将 BufferedImage 写入文件- Parameters:
bfi- BufferedImage图像- Returns:
- 写入的文件对象
-
zoomAndClip
public static BufferedImage zoomAndClip(File src, double scale, ImageUtils.Point start, int w, int h) throws IOException - Throws:
IOException
-
generateImage
- Parameters:
imgStr- 图片数据outFile- 输出文件- Returns:
- 文件
-
generateImage
根据base64串生成文件- Parameters:
imgStr- base64串outDir- 输出目录suffix- 扩展名- Returns:
- 文件
-
generatePngImage
生成png图片- Parameters:
imgStr- base64 image信息串- Returns:
- 图片文件
-
getImageStr
图片转换成base64串- Parameters:
imgFile- 图片文件- Returns:
- base64 图片信息串
-
baiduOcr
-