groupdocs-free-consulting / projects

0 stars 0 forks source link

I want to convert psd file to jpg #26

Open baozezhong opened 1 year ago

baozezhong commented 1 year ago

I want to convert psd file to jpg,But according to other tutorials on the official website, execute the error

Programming language:java error logs:Caused by: class com.groupdocs.conversion.internal.c.a.i.coreexceptions.f: Cannot open an image. The image file format may be not supported at the moment. maven version:

com.groupdocs groupdocs-conversion 22.8.1
baozezhong commented 1 year ago
 // 加载源文件 PSD 进行转换
    try (Converter converter = new Converter(new FileInputStream("/Users/imaker/Downloads/video/picture/input.psd"))) {
    // 为目标格式 JPG 准备转换选项
        ConvertOptions convertOptions = FileType.fromExtension("jpg").getConvertOptions();
    // 转换为 JPG 格式
        converter.convert("/Users/imaker/Downloads/video/picture/output.jpg", convertOptions);
    } catch (FileNotFoundException e) {
        throw new RuntimeException(e);
    }
atirtahirgroupdocs commented 1 year ago

@baozezhong

Could you please share the problematic PSD file? Furthermore, we'd recommend you to always raise such an issue on GroupDocs forum.