Bug 512958 - Saving image as AVIF after cropping crashes.
Summary: Saving image as AVIF after cropping crashes.
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: ImageEditor-Save (other bugs)
Version First Reported In: 8.8.0
Platform: macOS (DMG) macOS
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-04 22:18 UTC by gordon.runkle
Modified: 2025-12-25 10:54 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 9.0.0
Sentry Crash Report:


Attachments
Debug info and backtrace (81.21 KB, text/plain)
2025-12-05 14:26 UTC, gordon.runkle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gordon.runkle 2025-12-04 22:18:12 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY


STEPS TO REPRODUCE
1.  Select an image
2.  Crop image
3.  Attempt to save image

OBSERVED RESULT
digikam immediately crashes

EXPECTED RESULT
Cropped image should be saved.

SOFTWARE/OS VERSIONS
Windows: 
macOS:  macOS 26.1
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 caulier.gilles 2025-12-05 03:34:45 UTC
Which file format did you use to save the cropped image ?

Can you share the original file not cropped to try to reproduce the crash ?

We need a backtrace of the crash. See instructions here : https://www.digikam.org/contribute/#macos-host-1
Comment 2 gordon.runkle 2025-12-05 14:24:08 UTC
The image is a bit too big to attach, so I've shared it at:
https://www.icloud.com/iclouddrive/013abmdbtesByZSHIuWxsVZGA#270880_20240916143301_1

It happens with any image, though.

I'm using the "Save Changes" button, and never get a dialog, it crashes at that point.  This original is a PNG, though it happens with JPG files as well.
Comment 3 gordon.runkle 2025-12-05 14:26:02 UTC
Created attachment 187360 [details]
Debug info and backtrace

The requested debug info, made with the -debug version of digikam.
Comment 4 Maik Qualmann 2025-12-05 16:24:33 UTC
We're already familiar with the libaom crash on macOS. You're saving the modified images in AVIF format.

Gilles needs to check again whether there are any dependencies in the libaom compilation.

Maik
Comment 5 caulier.gilles 2025-12-05 16:54:47 UTC
Hi Maik,

Under macOS, macport provides libaom dependency :

https://ports.macports.org/port/aom/details/

There is no extra dependency for libaom

There is no special compilation option :

https://github.com/macports/macports-ports/blob/master/multimedia/aom/Portfile#L44

So for me the crash is typically an issue under macOS.

Searching for a bug : https://aomedia.issues.chromium.org/issues?q=macos%20crash

All are closed as fixed.

Gordon,

Please file a new report here (you need an account) :

https://aomedia.issues.chromium.org/issues

Best

Gilles Caulier
Comment 6 caulier.gilles 2025-12-05 17:00:33 UTC
Maik,

If AVIF is the problem, we must take a look at libavif in Macports:

 https://ports.macports.org/port/libavif/details/

This one has many dependencies as libaom of course. AOM support is not a variant and cannot be disabled directly.

https://github.com/macports/macports-ports/blob/master/multimedia/libavif/Portfile#L54

If AOM is the problem i can disable it to patch the libavif port config file, but i fair that the AVIF format will not provide a suitable output file as it's the default codec used. So i think the aom bug report must be done.

Best

Gilles
Comment 7 gordon.runkle 2025-12-05 17:04:44 UTC
I do have libaom 3.13.1 installed, as well as libavif: stable 1.3.0, so you're probably correct that I should file a report over there.

Thanks, all, for looking into this!
Comment 8 Maik Qualmann 2025-12-05 20:23:41 UTC
Hi Gilles, can you reproduce the crash? There are CPU flags during compilation.

-DAOM_TARGET_CPU=generic or arm64 or x86 or x86_64 etc.

Maik
Comment 9 caulier.gilles 2025-12-06 03:03:11 UTC
I just tested to export one HEIF from my collection to AVIF, (loosless or not). Image editor do not crash under my macbook pro M1.

Gilles
Comment 10 caulier.gilles 2025-12-06 03:10:36 UTC
I just tested to export the "Oversized truck" PNG file shared by Gordon to AVIF, (lossless or not). Image editor do not crash under my macbook pro M1.

Here i use digiKam 8.9.0 pre-release of course.

Gordon, if you want to test the 8.9.0 pre-release, files are here:

https://files.kde.org/digikam/

Q to Gordon: Did you use a Silicon or Intel Mac ?

Gilles
Comment 11 caulier.gilles 2025-12-06 03:14:23 UTC
Note: exporting image to AVIF cropped or not give the same result : no crash. So no problem at all with crop feature.

Gilles
Comment 12 gordon.runkle 2025-12-06 11:10:51 UTC
I"m on Apple Silicon.

It's the "Save Changes" which is crashing, not the "Save As New Version", just in case I wasn't clear.
Comment 13 caulier.gilles 2025-12-06 11:56:01 UTC
I set the Image Editor versionning to AVIF, and cropped you truck PNG photo without crashing using Save Changes under my Macbook pro M1.
Comment 14 caulier.gilles 2025-12-06 11:57:18 UTC
As i rebuild all the build env. from scratch one week ago using macports, can you try to reproduce the crash with the 8.9.0 pre-release PKG installer :

https://files.kde.org/digikam/
Comment 15 gordon.runkle 2025-12-06 12:20:57 UTC
(In reply to caulier.gilles from comment #10)
> I just tested to export the "Oversized truck" PNG file shared by Gordon to
> AVIF, (lossless or not). Image editor do not crash under my macbook pro M1.
> 
> Here i use digiKam 8.9.0 pre-release of course.
> 
> Gordon, if you want to test the 8.9.0 pre-release, files are here:
> 
> https://files.kde.org/digikam/
> 
> Q to Gordon: Did you use a Silicon or Intel Mac ?
> 
> Gilles

The 8.9.0 pre-release is working, thank you!  
I'm on Apple Silicon.
Comment 16 caulier.gilles 2025-12-06 12:23:28 UTC
Excellent. I close this file now...

Gilles