Model view controller 在png上播放framework Image.resize会失去透明度
我正在使用play framework 1.2.4。我对Image.resize()方法有问题,该方法正在删除png图像中的透明度 我的代码如下所示:Model view controller 在png上播放framework Image.resize会失去透明度,model-view-controller,upload,playframework,image,image-resizing,Model View Controller,Upload,Playframework,Image,Image Resizing,我正在使用play framework 1.2.4。我对Image.resize()方法有问题,该方法正在删除png图像中的透明度 我的代码如下所示: public static void uploadPhoto(int user_id, File picture) throws IOException{ Images.resize(picture, picture, 200, 200, true); FileInputStream f = new FileI
public static void uploadPhoto(int user_id, File picture) throws IOException{
Images.resize(picture, picture, 200, 200, true);
FileInputStream f = new FileInputStream(picture);
user.getPerson().setPicture(IOUtils.toByteArray(f));
user.getPerson().save();
...
}
我想知道如何在不丢失PNG透明度的情况下调整大小
谢谢。查看
play.libs.Images
的源代码,设置新大小的图像时(第102行),图像默认为白色背景。这似乎是您的透明度丢失的原因
我想这是一只虫子