Skip to content

ICO: Writing using default compression (uncompressed) creates inverted colors #1114

@muyitimha

Description

@muyitimha
<dependency>
	<groupId>com.twelvemonkeys.imageio</groupId>
	<artifactId>imageio-bmp</artifactId>
	<version>3.12.0</version>
</dependency> 

This is the bmp plugin for the Twelve monkeys introduced in the project.

private String transfer(
	String source,
	String destination,
	String format
) {
	try {
		BufferedImage image = ImageIO.read(new File(source));
		boolean success = ImageIO.write(image, format, new File(destination));
		if (success==false) {
			return "Failed";
		}else {
			return null;
		}
	} catch (Exception e) {
		log.error("",e);
		return "Exception";
	}
} 

This is my transfer method.

Hi, haraldk.
ImageIO.getReaderFileSuffixes() and ImageIO.getWriterFileSuffixes(), both printed out ico. When I used the transfer method to transfer jpeg image to ico image, ImageIO.write(image, format, new File(destination)) returnd false.
Would you tell me how to transfer jpeg image to ico image?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions