ExifTool failed with error: Error: Can't create TIFF files from scratch

Started by sksahu1206, January 20, 2025, 11:39:32 AM

Previous topic - Next topic

sksahu1206

exiftool version: 12.29
While perform below command with above exiftool version it is throwing below exception with DNG file.

COMMAND: exiftool.exe -m -IPTC:Keywords=test -o C:\devtools\52\output\test_out.dng C:\devtools\52\test_in.dng

2025-01-20 17:28:46.839  WARN 18856 --- [       Thread-2] c.o.d.image.exiftool.ExifToolRunnable    : Running ExifTool process exited with code: 1
2025-01-20 17:28:46.839+0530 [] [Thread-2] WARN  com.image.exiftool.ExifToolRunnable - parseResult: Running ExifTool process exited with code: 1
2025-01-20 17:28:46.839 ERROR 18856 --- [       Thread-2] c.o.d.image.exiftool.ExifToolRunnable    : ExifTool failed with error:
Error: Can't create TIFF files from scratch
2025-01-20 17:28:46.839+0530 [] [Thread-2] ERROR com.image.exiftool.ExifToolRunnable - parseResult: ExifTool failed with error:
Error: Can't create TIFF files from scratch
2025-01-20 17:28:46.840 ERROR 18856 --- [pool-3-thread-1] c.o.d.i.service.ImageProcessingService   : Unable to edit properties using ExifTool: jobId: 1 Source File: C:\devtools\52\test_in.dng
2025-01-20 17:28:46.840+0530 [] [pool-3-thread-1] ERROR com.image.service.ImageProcessingService - runEditPropertiesJob: Unable to edit properties using ExifTool: jobId: 1 Source File: C:\devtools\52\test_in.dng
2025-01-20 17:28:46.853 ERROR 18856 --- [pool-3-thread-1] c.o.d.image.processor.DMTSImageClient    : Service Exception: Job failed.
Error: Can't create TIFF files from scratch
2025-01-20 17:28:46.853+0530 [] [pool-3-thread-1] ERROR com.image.processor.DMTSImageClient - requestTransformation: Service Exception: Job failed.
Error: Can't create TIFF files from scratch
2025-01-20 17:28:46.853 ERROR 18856 --- [pool-3-thread-1] c.o.d.i.s.ImageTransformationListener    : Exception processing transformation d2c4762c-a7ab-4b34-bdb8-f9965db8c6a0: Job failed.
Error: Can't create TIFF files from scratch

But the above command execution is successful with exiftool version 13.03.
May I know is there any fix has been done in 13+ versions to address this issue. Also is there any workaround for backward compatibility?

Thanks,
Sunil

Phil Harvey

Hi Sunil,

I have tried this command with 12.29 and it works for me.  I suspect the command is different from what you state.  Even if the source dng isn't actually a dng file, you will get this warning instead of the one you are seeing:

Error: Can't create TIFF files from other types
Try your command from the command line, and if it persists then maybe there is something specific about the dng file that is doing something funny.  In this case, send me the dng so I can try to reproduce this error (philharvey66 at gmail.com)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Quote from: sksahu1206 on January 20, 2025, 11:39:32 AMMay I know is there any fix has been done in 13+ versions to address this issue. Also is there any workaround for backward compatibility?

You mean 74 versions. See the version history page and ancient history page for full details


Also, version 12.29, July 9, 2021 is over 3½ years old.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

sksahu1206

#3
Hi Phil,

COMMAND:
exiftool.exe -m -IPTC:Keywords=test -o C:\devtools\52\output\test_out.dng C:\devtools\52\test_in.dng

Above peace of code is working fine when executed it from command line, but not working after integrating in a spring boot application.

There are 3 scenarios:
1. Executed from command line: Worked fine, metadata got overridden
2. Executed from Standalone code: Didn't throw any Error but metadata not overridden
3. Executed from Springboot app: Thrown Error: Can't create TIFF files from scratch

Thanks,
Sunil

Phil Harvey

Hi Sunil,

Your command line must be different when executed from the Springboot app.  This is probably some sort of quoting/escaping problem.

When run from other environments, the current working directory, PATH and user/group permissions may be different, and may cause problems such as case 2.

But this isn't an ExifTool problem.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

sksahu1206

Hi Phil,

I have logged the commands executed in different scenarios, as mentioned in previous comment. There is no difference I have observed. Even I have generated the ASCII to find out any hidden chars. Below is the standalone code I have created to test the execution. Please don't simply run, instead debug the code to generate the output folder with image.
When you check the metadata of generated image will not find the overridden test with in it.

public static void main(String[] args) throws IOException {
        String[] command = new String[5];
        command[0] = "exiftool.exe";
        command[1] = "-IPTC:Keywords=test";
        command[2] = "-o";
        command[3] = "C:\\devtools\\12\\output\\DMGfile.dng";
        command[4] = "C:\\devtools\\12\\DMGfile.dng";
        File workingDir = new File("C:\\devtools\\12");
        execCommand(command, workingDir);
    }

    public static void execCommand(String[] command, File workingDir) throws IOException
    {
        Process process = null;
        StringBuilder stdoutBuilder = new StringBuilder(256);
        StringBuilder stderrBuilder = new StringBuilder(256);
        BufferedReader stdoutReader = null;
        BufferedReader stderrReader = null;
        boolean warnedStdoutBuffer = false;
        boolean warnedStderrBuffer = false;
        try
        {
                for (int i = 0; i < command.length; i++) {
                    if(command[i].contains("-XMP:Subject")
                            || command[i].contains("-IPTC:Keywords")) {
                        command[i] = " -m " + command[i];
                    }
                }
                for(String cmd : command)
                {
                    System.out.print(cmd + " ");
                }
                if (Stream.of(command).anyMatch(cmd -> cmd.contains("exiftool")))
                {
                    process = Runtime.getRuntime().exec(command);
                }
                else
                {
                    process = Runtime.getRuntime().exec(command, null, workingDir);
                }

                // Read from input and error streams
                stdoutReader = new BufferedReader(new InputStreamReader(process.getInputStream(), "UTF-8"));
                stderrReader = new BufferedReader(new InputStreamReader(process.getErrorStream(), "UTF-8"));

                long startTime = System.currentTimeMillis();
        }
        catch (Exception ie)
        {
        }
        finally {
            if (process != null) {
                try {
                    process.destroy();
                } catch (Throwable t) {
                }
            }
        }
    }



Thanks,
Sunil

Phil Harvey

Hi Sunil,

I can see an obvious bug in your code.  Please take a close look at your code and fix your problems first.  It shouldn't be my place to teach you how to write your software.

Like I said, this isn't an ExifTool problem.

I'm sorry for not being more helpful, but I've lost patience for debugging other people's problems because I've been wasting too much time doing this recently.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).


sksahu1206

In case if anyone looking for this issue, then the issue occurred due to below line in my code-
command[i] = " -m " + command[i];Instead of appending to the same "-m" to the same index of the array, I have added to a new index with in the array to resolve the issue.