`
sunxboy
  • 浏览: 2869821 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

JAVA 生成高品质缩略图(转)

阅读更多

ScaleImage.java

 

import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;

//生成等比例高质量缩略图
public class ScaleImage {
    private int width;

    private int height;

    private int scaleWidth;

    double support = (double) 3.0;

    double PI = (double) 3.14159265358978;

    double[] contrib;

    double[] normContrib;

    double[] tmpContrib;

    int startContrib, stopContrib;

    int nDots;

    int nHalfDots;

    /** *//**
     * Start: Use Lanczos filter to replace the original algorithm for image
     * scaling. Lanczos improves quality of the scaled image modify by :blade
     */

    public static void main(String[] args) {
        ScaleImage is = new ScaleImage();
        try {
            is.saveImageAsJpg("d:/firefox.jpg", "d:/test.jpg", 768,
                    680);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    // fromFileStr原图片地址,saveToFileStr生成缩略图地址,formatWideth生成图片宽度,formatHeight高度
    public void saveImageAsJpg(String fromFileStr, String saveToFileStr,
            int formatWideth, int formatHeight) throws Exception {
        BufferedImage srcImage;
        File saveFile = new File(saveToFileStr);
        File fromFile = new File(fromFileStr);
        srcImage = javax.imageio.ImageIO.read(fromFile); // construct image
        int imageWideth = srcImage.getWidth(null);
        int imageHeight = srcImage.getHeight(null);
        int changeToWideth = 0;
        int changeToHeight = 0;
        if (imageWideth > 0 && imageHeight > 0) {
            // flag=true;
            if (imageWideth / imageHeight >= formatWideth / formatHeight) {
                if (imageWideth > formatWideth) {
                    changeToWideth = formatWideth;
                    changeToHeight = (imageHeight * formatWideth) / imageWideth;
                } else {
                    changeToWideth = imageWideth;
                    changeToHeight = imageHeight;
                }
            } else {
                if (imageHeight > formatHeight) {
                    changeToHeight = formatHeight;
                    changeToWideth = (imageWideth * formatHeight) / imageHeight;
                } else {
                    changeToWideth = imageWideth;
                    changeToHeight = imageHeight;
                }
            }
        }

        srcImage = imageZoomOut(srcImage, changeToWideth, changeToHeight);
        ImageIO.write(srcImage, "JPEG", saveFile);
    }

    public BufferedImage imageZoomOut(BufferedImage srcBufferImage, int w, int h) {
        width = srcBufferImage.getWidth();
        height = srcBufferImage.getHeight();
        scaleWidth = w;

        if (DetermineResultSize(w, h) == 1) {
            return srcBufferImage;
        }
        CalContrib();
        BufferedImage pbOut = HorizontalFiltering(srcBufferImage, w);
        BufferedImage pbFinalOut = VerticalFiltering(pbOut, h);
        return pbFinalOut;
    }

    /** *//**
     * 决定图像尺寸
     */
    private int DetermineResultSize(int w, int h) {
        double scaleH, scaleV;
        scaleH = (double) w / (double) width;
        scaleV = (double) h / (double) height;
        // 需要判断一下scaleH,scaleV,不做放大操作
        if (scaleH >= 1.0 && scaleV >= 1.0) {
            return 1;
        }
        return 0;

    } // end of DetermineResultSize()

    private double Lanczos(int i, int inWidth, int outWidth, double Support) {
        double x;

        x = (double) i * (double) outWidth / (double) inWidth;

        return Math.sin(x * PI) / (x * PI) * Math.sin(x * PI / Support)
                / (x * PI / Support);

    }

    private void CalContrib() {
        nHalfDots = (int) ((double) width * support / (double) scaleWidth);
        nDots = nHalfDots * 2 + 1;
        try {
            contrib = new double[nDots];
            normContrib = new double[nDots];
            tmpContrib = new double[nDots];
        } catch (Exception e) {
            System.out.println("init   contrib,normContrib,tmpContrib" + e);
        }

        int center = nHalfDots;
        contrib[center] = 1.0;

        double weight = 0.0;
        int i = 0;
        for (i = 1; i <= center; i++) {
            contrib[center + i] = Lanczos(i, width, scaleWidth, support);
            weight += contrib[center + i];
        }

        for (i = center - 1; i >= 0; i--) {
            contrib[i] = contrib[center * 2 - i];
        }

        weight = weight * 2 + 1.0;

        for (i = 0; i <= center; i++) {
            normContrib[i] = contrib[i] / weight;
        }

        for (i = center + 1; i < nDots; i++) {
            normContrib[i] = normContrib[center * 2 - i];
        }
    } // end of CalContrib()

    // 处理边缘
    private void CalTempContrib(int start, int stop) {
        double weight = 0;

        int i = 0;
        for (i = start; i <= stop; i++) {
            weight += contrib[i];
        }

        for (i = start; i <= stop; i++) {
            tmpContrib[i] = contrib[i] / weight;
        }

    } // end of CalTempContrib()

    private int GetRedValue(int rgbValue) {
        int temp = rgbValue & 0x00ff0000;
        return temp >> 16;
    }

    private int GetGreenValue(int rgbValue) {
        int temp = rgbValue & 0x0000ff00;
        return temp >> 8;
    }

    private int GetBlueValue(int rgbValue) {
        return rgbValue & 0x000000ff;
    }

    private int ComRGB(int redValue, int greenValue, int blueValue) {

        return (redValue << 16) + (greenValue << 8) + blueValue;
    }

    // 行水平滤波
    private int HorizontalFilter(BufferedImage bufImg, int startX, int stopX,
            int start, int stop, int y, double[] pContrib) {
        double valueRed = 0.0;
        double valueGreen = 0.0;
        double valueBlue = 0.0;
        int valueRGB = 0;
        int i, j;

        for (i = startX, j = start; i <= stopX; i++, j++) {
            valueRGB = bufImg.getRGB(i, y);

            valueRed += GetRedValue(valueRGB) * pContrib[j];
            valueGreen += GetGreenValue(valueRGB) * pContrib[j];
            valueBlue += GetBlueValue(valueRGB) * pContrib[j];
        }

        valueRGB = ComRGB(Clip((int) valueRed), Clip((int) valueGreen),
                Clip((int) valueBlue));
        return valueRGB;

    } // end of HorizontalFilter()

    // 图片水平滤波
    private BufferedImage HorizontalFiltering(BufferedImage bufImage, int iOutW) {
        int dwInW = bufImage.getWidth();
        int dwInH = bufImage.getHeight();
        int value = 0;
        BufferedImage pbOut = new BufferedImage(iOutW, dwInH,
                BufferedImage.TYPE_INT_RGB);

        for (int x = 0; x < iOutW; x++) {

            int startX;
            int start;
            int X = (int) (((double) x) * ((double) dwInW) / ((double) iOutW) + 0.5);
            int y = 0;

            startX = X - nHalfDots;
            if (startX < 0) {
                startX = 0;
                start = nHalfDots - X;
            } else {
                start = 0;
            }

            int stop;
            int stopX = X + nHalfDots;
            if (stopX > (dwInW - 1)) {
                stopX = dwInW - 1;
                stop = nHalfDots + (dwInW - 1 - X);
            } else {
                stop = nHalfDots * 2;
            }

            if (start > 0 || stop < nDots - 1) {
                CalTempContrib(start, stop);
                for (y = 0; y < dwInH; y++) {
                    value = HorizontalFilter(bufImage, startX, stopX, start,
                            stop, y, tmpContrib);
                    pbOut.setRGB(x, y, value);
                }
            } else {
                for (y = 0; y < dwInH; y++) {
                    value = HorizontalFilter(bufImage, startX, stopX, start,
                            stop, y, normContrib);
                    pbOut.setRGB(x, y, value);
                }
            }
        }

        return pbOut;

    } // end of HorizontalFiltering()

    private int VerticalFilter(BufferedImage pbInImage, int startY, int stopY,
            int start, int stop, int x, double[] pContrib) {
        double valueRed = 0.0;
        double valueGreen = 0.0;
        double valueBlue = 0.0;
        int valueRGB = 0;
        int i, j;

        for (i = startY, j = start; i <= stopY; i++, j++) {
            valueRGB = pbInImage.getRGB(x, i);

            valueRed += GetRedValue(valueRGB) * pContrib[j];
            valueGreen += GetGreenValue(valueRGB) * pContrib[j];
            valueBlue += GetBlueValue(valueRGB) * pContrib[j];
            // System.out.println(valueRed+"->"+Clip((int)valueRed)+"<-");
            //   
            // System.out.println(valueGreen+"->"+Clip((int)valueGreen)+"<-");
            // System.out.println(valueBlue+"->"+Clip((int)valueBlue)+"<-"+"-->");
        }

        valueRGB = ComRGB(Clip((int) valueRed), Clip((int) valueGreen),
                Clip((int) valueBlue));
        // System.out.println(valueRGB);
        return valueRGB;

    } // end of VerticalFilter()

    private BufferedImage VerticalFiltering(BufferedImage pbImage, int iOutH) {
        int iW = pbImage.getWidth();
        int iH = pbImage.getHeight();
        int value = 0;
        BufferedImage pbOut = new BufferedImage(iW, iOutH,
                BufferedImage.TYPE_INT_RGB);

        for (int y = 0; y < iOutH; y++) {

            int startY;
            int start;
            int Y = (int) (((double) y) * ((double) iH) / ((double) iOutH) + 0.5);

            startY = Y - nHalfDots;
            if (startY < 0) {
                startY = 0;
                start = nHalfDots - Y;
            } else {
                start = 0;
            }

            int stop;
            int stopY = Y + nHalfDots;
            if (stopY > (int) (iH - 1)) {
                stopY = iH - 1;
                stop = nHalfDots + (iH - 1 - Y);
            } else {
                stop = nHalfDots * 2;
            }

            if (start > 0 || stop < nDots - 1) {
                CalTempContrib(start, stop);
                for (int x = 0; x < iW; x++) {
                    value = VerticalFilter(pbImage, startY, stopY, start, stop,
                            x, tmpContrib);
                    pbOut.setRGB(x, y, value);
                }
            } else {
                for (int x = 0; x < iW; x++) {
                    value = VerticalFilter(pbImage, startY, stopY, start, stop,
                            x, normContrib);
                    pbOut.setRGB(x, y, value);
                }
            }

        }

        return pbOut;

    } // end of VerticalFiltering()

    int Clip(int x) {
        if (x < 0)
            return 0;
        if (x > 255)
            return 255;
        return x;
    }
}

 

-------------------------------------------------------------------------------------------------

ImageScale.java

 

import java.awt.image.BufferedImage;

public class ImageScale {
	private int width;
	private int height;
	private int scaleWidth;
	double support = (double) 3.0;
	double PI = (double) 3.14159265358978;
	double[] contrib;
	double[] normContrib;
	double[] tmpContrib;
	int startContrib, stopContrib;
	int nDots;
	int nHalfDots;

	/**  
	 *   Start:  
	 *   Use   Lanczos   filter   to   replace   the   original   algorithm   for   image   scaling.   Lanczos   improves   quality   of   the   scaled   image  
	 *   modify   by   :blade  
	 *   */
	public BufferedImage imageZoomOut(BufferedImage srcBufferImage, int w, int h) {
		width = srcBufferImage.getWidth();
		height = srcBufferImage.getHeight();
		scaleWidth = w;

		if (DetermineResultSize(w, h) == 1) {
			return srcBufferImage;
		}
		CalContrib();
		BufferedImage pbOut = HorizontalFiltering(srcBufferImage, w);
		BufferedImage pbFinalOut = VerticalFiltering(pbOut, h);
		return pbFinalOut;
	}

	/**  
	 *   决定图像尺寸  
	 *   */
	private int DetermineResultSize(int w, int h) {
		double scaleH, scaleV;
		scaleH = (double) w / (double) width;
		scaleV = (double) h / (double) height;
		//需要判断一下scaleH,scaleV,不做放大操作  
		if (scaleH >= 1.0 && scaleV >= 1.0) {
			return 1;
		}
		return 0;

	} //   end   of   DetermineResultSize()  

	private double Lanczos(int i, int inWidth, int outWidth, double Support) {
		double x;

		x = (double) i * (double) outWidth / (double) inWidth;

		return Math.sin(x * PI) / (x * PI) * Math.sin(x * PI / Support)
				/ (x * PI / Support);

	} //   end   of   Lanczos()  

	//  
	//       Assumption:   same   horizontal   and   vertical   scaling   factor  
	//  
	private void CalContrib() {
		nHalfDots = (int) ((double) width * support / (double) scaleWidth);
		nDots = nHalfDots * 2 + 1;
		try {
			contrib = new double[nDots];
			normContrib = new double[nDots];
			tmpContrib = new double[nDots];
		} catch (Exception e) {
			System.out.println("init   contrib,normContrib,tmpContrib" + e);
		}

		int center = nHalfDots;
		contrib[center] = 1.0;

		double weight = 0.0;
		int i = 0;
		for (i = 1; i <= center; i++) {
			contrib[center + i] = Lanczos(i, width, scaleWidth, support);
			weight += contrib[center + i];
		}

		for (i = center - 1; i >= 0; i--) {
			contrib[i] = contrib[center * 2 - i];
		}

		weight = weight * 2 + 1.0;

		for (i = 0; i <= center; i++) {
			normContrib[i] = contrib[i] / weight;
		}

		for (i = center + 1; i < nDots; i++) {
			normContrib[i] = normContrib[center * 2 - i];
		}
	} //   end   of   CalContrib()  

	//处理边缘  
	private void CalTempContrib(int start, int stop) {
		double weight = 0;

		int i = 0;
		for (i = start; i <= stop; i++) {
			weight += contrib[i];
		}

		for (i = start; i <= stop; i++) {
			tmpContrib[i] = contrib[i] / weight;
		}

	} //   end   of   CalTempContrib()  

	private int GetRedValue(int rgbValue) {
		int temp = rgbValue & 0x00ff0000;
		return temp >> 16;
	}

	private int GetGreenValue(int rgbValue) {
		int temp = rgbValue & 0x0000ff00;
		return temp >> 8;
	}

	private int GetBlueValue(int rgbValue) {
		return rgbValue & 0x000000ff;
	}

	private int ComRGB(int redValue, int greenValue, int blueValue) {

		return (redValue << 16) + (greenValue << 8) + blueValue;
	}

	//行水平滤波  
	private int HorizontalFilter(BufferedImage bufImg, int startX, int stopX,
			int start, int stop, int y, double[] pContrib) {
		double valueRed = 0.0;
		double valueGreen = 0.0;
		double valueBlue = 0.0;
		int valueRGB = 0;
		int i, j;

		for (i = startX, j = start; i <= stopX; i++, j++) {
			valueRGB = bufImg.getRGB(i, y);

			valueRed += GetRedValue(valueRGB) * pContrib[j];
			valueGreen += GetGreenValue(valueRGB) * pContrib[j];
			valueBlue += GetBlueValue(valueRGB) * pContrib[j];
		}

		valueRGB = ComRGB(Clip((int) valueRed), Clip((int) valueGreen),
				Clip((int) valueBlue));
		return valueRGB;

	} //   end   of   HorizontalFilter()  

	//图片水平滤波  
	private BufferedImage HorizontalFiltering(BufferedImage bufImage, int iOutW) {
		int dwInW = bufImage.getWidth();
		int dwInH = bufImage.getHeight();
		int value = 0;
		BufferedImage pbOut = new BufferedImage(iOutW, dwInH,
				BufferedImage.TYPE_INT_RGB);

		for (int x = 0; x < iOutW; x++) {

			int startX;
			int start;
			int X = (int) (((double) x) * ((double) dwInW) / ((double) iOutW) + 0.5);
			int y = 0;

			startX = X - nHalfDots;
			if (startX < 0) {
				startX = 0;
				start = nHalfDots - X;
			} else {
				start = 0;
			}

			int stop;
			int stopX = X + nHalfDots;
			if (stopX > (dwInW - 1)) {
				stopX = dwInW - 1;
				stop = nHalfDots + (dwInW - 1 - X);
			} else {
				stop = nHalfDots * 2;
			}

			if (start > 0 || stop < nDots - 1) {
				CalTempContrib(start, stop);
				for (y = 0; y < dwInH; y++) {
					value = HorizontalFilter(bufImage, startX, stopX, start,
							stop, y, tmpContrib);
					pbOut.setRGB(x, y, value);
				}
			} else {
				for (y = 0; y < dwInH; y++) {
					value = HorizontalFilter(bufImage, startX, stopX, start,
							stop, y, normContrib);
					pbOut.setRGB(x, y, value);
				}
			}
		}

		return pbOut;

	} //   end   of   HorizontalFiltering()  

	private int VerticalFilter(BufferedImage pbInImage, int startY, int stopY,
			int start, int stop, int x, double[] pContrib) {
		double valueRed = 0.0;
		double valueGreen = 0.0;
		double valueBlue = 0.0;
		int valueRGB = 0;
		int i, j;

		for (i = startY, j = start; i <= stopY; i++, j++) {
			valueRGB = pbInImage.getRGB(x, i);

			valueRed += GetRedValue(valueRGB) * pContrib[j];
			valueGreen += GetGreenValue(valueRGB) * pContrib[j];
			valueBlue += GetBlueValue(valueRGB) * pContrib[j];
			//     System.out.println(valueRed+"->"+Clip((int)valueRed)+"<-");  
			//  
			//     System.out.println(valueGreen+"->"+Clip((int)valueGreen)+"<-");  
			//     System.out.println(valueBlue+"->"+Clip((int)valueBlue)+"<-"+"-->");  
		}

		valueRGB = ComRGB(Clip((int) valueRed), Clip((int) valueGreen),
				Clip((int) valueBlue));
		//       System.out.println(valueRGB);  
		return valueRGB;

	} //   end   of   VerticalFilter()  

	private BufferedImage VerticalFiltering(BufferedImage pbImage, int iOutH) {
		int iW = pbImage.getWidth();
		int iH = pbImage.getHeight();
		int value = 0;
		BufferedImage pbOut = new BufferedImage(iW, iOutH,
				BufferedImage.TYPE_INT_RGB);

		for (int y = 0; y < iOutH; y++) {

			int startY;
			int start;
			int Y = (int) (((double) y) * ((double) iH) / ((double) iOutH) + 0.5);

			startY = Y - nHalfDots;
			if (startY < 0) {
				startY = 0;
				start = nHalfDots - Y;
			} else {
				start = 0;
			}

			int stop;
			int stopY = Y + nHalfDots;
			if (stopY > (int) (iH - 1)) {
				stopY = iH - 1;
				stop = nHalfDots + (iH - 1 - Y);
			} else {
				stop = nHalfDots * 2;
			}

			if (start > 0 || stop < nDots - 1) {
				CalTempContrib(start, stop);
				for (int x = 0; x < iW; x++) {
					value = VerticalFilter(pbImage, startY, stopY, start, stop,
							x, tmpContrib);
					pbOut.setRGB(x, y, value);
				}
			} else {
				for (int x = 0; x < iW; x++) {
					value = VerticalFilter(pbImage, startY, stopY, start, stop,
							x, normContrib);
					pbOut.setRGB(x, y, value);
				}
			}

		}

		return pbOut;

	} //   end   of   VerticalFiltering()  

	int Clip(int x) {
		if (x < 0)
			return 0;
		if (x > 255)
			return 255;
		return x;
	}

	/**  
	 *   End:  
	 *   Use   Lanczos   filter   to   replace   the   original   algorithm   for   image   scaling.   Lanczos   improves   quality   of   the   scaled   image  
	 *   modify   by   :blade  
	 *   */

}
 

 

 

 

 

 

分享到:
评论
3 楼 sundysea 2008-10-11  
我重新写了一个 压缩图片,个人感觉很满意。不会出现我说的这个问题了,大家可以参考
这个是我在csdn博客发表的。
http://blog.csdn.net/feng_sundy/archive/2008/08/05/2769572.aspx
2 楼 sunxboy 2008-08-03  
这个,这个............
1 楼 sundysea 2008-08-02  
部分图片压缩的时候,我用了一个图片只有430k,1600 X 1565,可是大概压缩了5分钟才完成,这样的速度,无法接受。
我的机器配置Intel Coro2 4400 2G内存

但是我压缩有的图片2M,3072X2048 就很快,不知道是什么原因呢?

相关推荐

    java 图片生成缩略图

    "java 图片生成缩略图" Java 图片生成缩略图是Java程序开发中一个常见的需求,通过...本文介绍了使用Java生成缩略图的方法和原理,并讨论了缩略图生成的优点。通过使用Java生成缩略图,可以提高网站的性能和用户体验。

    java 上传图片生成缩略图

    ### Java 上传图片生成缩略图的知识点解析 在现代Web开发中,处理图像是一项常见的需求,尤其是在涉及用户上传图片的应用场景中。本篇文章将基于提供的代码片段详细讲解如何使用Java来实现上传图片并自动生成缩略图...

    java视频生成图片(缩略图)-实例-(指定时间)

    在Java编程中,生成视频的缩略图是一项常见的任务,特别是在多媒体处理或视频分享平台的开发中。这个实例主要关注如何使用Java在指定的时间点截取视频生成图片。以下是一些相关的知识点: 1. **Java Media ...

    java生成缩略图类(已经封装好)

    java 生成缩略图类 源代码 (已经封装好)

    JAVA获取视频缩略图

    在Java编程环境中,获取视频缩略图是一项常见的需求,尤其在多媒体应用或者视频分享平台中。这个过程涉及到多媒体处理和图像操作的知识。本文将详细解释如何在Java中实现这一功能,以及相关的技术点。 首先,Java...

    java上传图片,处理图片,word转pdf图片缩略图生成

    java上传图片,处理图片,word转pdf图片缩略图生成,替换所有图片的ip地址工具类

    java生成图片缩略图和二进制文件的工具类

    将图片生成缩略图和转换为二进制的工具类,缩略图大小可调

    生成网页缩略图(输入网址,宽度,高度生成缩略图)

    网页缩略图生成技术是一种常见的Web开发功能,它允许用户通过输入网址、设定目标宽度和高度,快速获取网站页面的预览图片。这种技术在许多应用场景中非常实用,例如社交媒体分享、搜索引擎结果展示、网站目录索引等...

    上传图片并生成高清晰缩略图

    ### 上传图片并生成高清晰缩略图 #### 背景与概述 在Web开发领域,特别是ASP.NET应用程序中,上传图片并自动生成高质量缩略图是一项常见且实用的功能。这种需求通常出现在用户头像上传、产品图片展示等场景中。...

    java大图生成缩略图。。。。

    java大图生成缩略图。。。。。。。。。。。。

    java生成缩略图

    #### 缩略图生成的原理 生成缩略图的核心在于对原始图像进行等比例缩小处理,以保持图像的比例不变。在Java中,主要通过`java.awt.image.BufferedImage`类及其相关方法来实现。 ### Java生成缩略图的技术细节 ####...

    java缩略图代码

    在 Java 中生成图片缩略图是一项常见的需求,这通常涉及到图像处理技术。以下是一个 Java 类 `GetPicture` 的示例,它包含了获取网络图片、截取屏幕以及创建图片缩略图的功能。我们将详细解释其中的关键知识点。 1....

    Java中gif动图缩略图处理jar包

    这个jar包为开发者提供了一个方便的API来处理GIF图像的缩略图生成,使得在Java项目中实现这一功能变得更加简单。 GIF4J库的核心功能包括读取GIF文件、解析其帧信息、调整图像尺寸并重新组合成新的GIF文件。以下是...

    java图片裁剪和java生成缩略图.pdf

    java图片裁剪和java生成缩略图.pdf

    java 生成缩略图

    在Java编程中,生成缩略图是一项常见的任务,特别是在处理图像处理、网页设计或移动应用开发时。这个任务涉及到读取原始图像,调整其尺寸,然后保存为较小的版本,即缩略图。在这个过程中,我们可以使用Java的内置库...

    java利用ffmpeg获取视频缩略图

    本项目就是关于如何在Java环境中使用ffmpeg来获取视频的缩略图,提供了一个简单易用的解决方案。 首先,ffmpeg是一个强大的命令行工具,它支持多种视频、音频格式的处理,包括转换、合并、剪辑以及生成缩略图等。在...

    java生成高清缩略图不丢真,java压缩图片

    网上找的缩略图生成方法都不够清晰,于是决定自己研究和改进生成缩略图方法。此方法压缩后的图片小,清晰度高,压缩速度快。5000张图片大概抽根烟的功夫就压缩完了。高清的哦。各种参数都是可配的,方便移植到自己...

    java批量上传图片并生成缩略图

    在Java编程环境中,批量上传图片并生成缩略图是一项常见的需求,特别是在开发Web应用时,例如内容管理系统或者论坛。这个任务通常涉及到文件处理、图像处理和服务器端编程等多个技术领域。接下来,我们将深入探讨...

    java生成缩略图.pdf

    在Java中生成缩略图是一项常见的任务,尤其是在开发Web应用或者需要处理用户上传图片的系统中。这个过程涉及对原始图像进行重新尺寸调整,以创建一个较小的版本,通常用于预览或节省存储空间。在提供的代码片段中,...

Global site tag (gtag.js) - Google Analytics