Lymphatus / caesium-image-compressor

Caesium is an image compression software that helps you store, send and share digital pictures, supporting JPG, PNG, WebP and TIFF formats. You can quickly reduce the file size (and resolution, if you want) by preserving the overall quality of the image.
https://saerasoft.com/caesium
GNU General Public License v3.0
3.6k stars 214 forks source link

Caesium silently crashes when compressing corrupted files #303

Open gdsa32 opened 1 week ago

gdsa32 commented 1 week ago

Describe the bug While compressing corrupted files, Caesium silently crashes due to the file being corrupted. The specific file in question is this: https://readcomicsonline.ru/uploads/manga/firefly-malcolm-reynolds-year-one-2024/chapters/1/34.jpg

Software version 2.7.1

Operating System information Windows 11

To Reproduce Steps to reproduce the behavior:

  1. Add the .jpg file linked above to the file list.
  2. Set some options to recompress
  3. Click 'Compress'
  4. Caesium will crash silently

If there's a long list of files to be processed, some of them will be compressed, some not.

Expected behavior Caesium shoud handle the corrupted file gracefully, ignoring its processing, but completing the other files on the list. A warning message in the 'Information' column, informing about the corrupted file not being processed would be great.

Application Log I tried to get the log, but, as the program crashes, no information about the corrupt file is registered.

Additional context When opening the file in Adobe Photoshop, it says the file is truncated or incomplete and then asks if I want to open it anyway. If I click Yes, the file is opened, but the bottom part is blank.

I searched for similar issues, and found #200 and #239, both are closed.

Here's my usage data:

System data
{
    "appVersion": "2.7.1",
    "cpuArchitecture": "x86_64",
    "kernelType": "winnt",
    "kernelVersion": "10.0.22635",
    "productType": "windows",
    "productVersion": "11",
    "uuid": "8e086062-de8c-4ac6-95f1-70a1fdb5e126"
}

Compression data
{
    "compressedSize": "...",
    "compressionOptions": {
        "compression/jpeg_chroma_subsampling": 0,
        "compression/jpeg_quality": 82,
        "compression/keep_metadata": "false",
        "compression/keep_structure": "false",
        "compression/lossless": "false",
        "compression/max_output_size": 500,
        "compression/max_output_size_unit": 0,
        "compression/mode": 0,
        "compression/png_level": 3,
        "compression/png_optimization_level": 3,
        "compression/png_quality": 85,
        "compression/tiff_deflate_level": 2,
        "compression/tiff_method": 1,
        "compression/webp_quality": 60,
        "output/format": 0,
        "output/keep_creation_date": "false",
        "output/keep_dates": 0,
        "output/keep_last_access_date": "false",
        "output/keep_last_modified_date": "false",
        "output/move_original_file": "true",
        "output/move_original_file_destination": 0,
        "output/output_folder": "",
        "output/output_suffix": "",
        "output/same_folder_as_input": "true",
        "output/skip_if_bigger": "true",
        "resize/do_not_enlarge": "true",
        "resize/fit_to": 6,
        "resize/height": 3056,
        "resize/keep_aspect_ratio": "false",
        "resize/resize": "true",
        "resize/size": 3056,
        "resize/width": 7
    },
    "elapsedTime": "...",
    "totalFiles": "...",
    "uncompressedSize": "...",
    "uuid": "8e086062-de8c-4ac6-95f1-70a1fdb5e126"
}
Lymphatus commented 1 week ago

The link you provided for the image seems unreachable on my side. Can you please provide an alternative link or way to download the image?

gdsa32 commented 1 week ago

34

Lymphatus commented 1 week ago

Seems an issue with resizing, as the program crashes trying to downsize the image. As a temporary solution while I try to fix it, you can try disabling resizing, compressing with Caesium, and then resizing the image with Caesium again (or another software).