Skip to main content
Interwork Corporation
IDR Solutions Product Support Portal
モードの切替 ダーク/ライト/自動 モードの切替 ダーク/ライト/自動 モードの切替 ダーク/ライト/自動

サムネイルの作成

何ができるのか?

指定された寸法で画像のコピーを作成します。この操作は、指定された寸法が元の画像よりも小さい場合に最適な出力を生成するように設計されたスケーリングルーチンを使用します。

JavaでBufferedImageをスケールする

ImageProcessingOperations operations = new ImageProcessingOperations();

// ここでスケール、ぼかしなど、複数の操作を連結できます
operations.thumbnail(64, 64); 
        
// BufferedImageに操作を適用します
BufferedImage modifiedImage = operations.apply(BufferedImage originalImage);

thumbnail操作のJavadocを表示

追加のコード例

以下のコード例を使用して、画像フォーマット間で処理および変換を行います:

Fileを使用する場合

File inputFile = new File("path/to/file");
File outputFile = new File("path/to/output-thumbnail-file");
JDeli.convert(inputFile, outputFile, operations);

InputStreamとOutputSteamを使用する場合

final InputStream inputStream = new FileInputStream(inputFile);
final OutputStream outputStream = new FileOutputStream(outputFile);
final String outputFormat = "format"; // 出力ファイルのフォーマット 例: png, jpeg,...;
JDeli.convert(inputStream, outputStream, outputFormat, operations);

byte[]を使用する場合

byte[] inputData = Files.readAllBytes(Paths.get("/path/to/file"));
final String outputFormat = "format"; // 出力ファイルのフォーマット 例: png, jpeg,...;
byte[] outputData = JDeli.convert(inputData, outputFormat, operations);