Skip to content

[BUG] - Gradient adjustment causes crash with large black canvas #726

Closed

Description

@rcchadburn

Version information

  • Photodemon 2025.12
  • Windows 11 25H2

Describe the bug

When I was trying to create my own gradient in a new document, with other documents open, Photodemon crashed. This is a repeatable crash without other documents open. The steps are below.

How can I reproduce the bug?

  1. click photo demon shortcut
  2. dont restore
  3. click new document (25x25 inches and 300 ppiblack)
  4. Go to gradient
  5. Click gradient and move cursor to create own gradient
  6. Photodemon crashes

Expected behavior

I have created my own gradients before, so I expected to be able to create my own color gradients in a new document on a black background as the base.

Debug logs

gradient error included.zip

Thank you!

Rebecca Chadburn

Activity

  1. rcchadburn commented on Dec 19, 2025

    @rcchadburn
    Author

    I have caused this same crash to happen with a canvas size of 15x15 in and white as well when I tried to operate the gradient in addition to the original bug I reported.

  2. tannerhelland commented on Dec 19, 2025

    @tannerhelland
    Owner

    Hello @rcchadburn . Thank you for filing this bug report! I apologize for PhotoDemon crashing on you. (Thank you also for attaching debug logs - it helps a ton.)

    I have tried to recreate the problem here but can't trigger a crash, so let's diagnose two possibilities.

    1. To eliminate the most obvious possibility - this being an out of memory issue - what happens if you attempt the above steps on a smaller image, like a 25" x 25" image at 200 DPI, or a 25" x 25" image at 100 DPI. (DPI is the critical setting here, as it has the largest impact on image size.) Do either of those work successfully?

    2. Does this crash also happen with the built-in PhotoDemon gradients, or only one(s) you've created? If it's the latter, can you attach the responsible gradient file(s) to this issue? (In the Gradient Editor > gradient collection window, there should be a clickable link at the bottom that will open the folder with all your saved gradients. The one(s) you've created should appear there as separate file(s), each in .svg format.)

    Thank you in advance for any further help you can provide.

  3. rcchadburn commented on Dec 21, 2025

    @rcchadburn
    Author

    When I try to access the gradient at all now, it crashes, and I am unsure as to why. I will probably try to experiment further with this in the next couple of days.

    I did a complicated select recently and crashed it when I tried to move on past the select phase of what I was doing. If I can repeat it in the morning, I may submit a separate ticket for it.

  4. marsa47 commented on Jan 25, 2026

    @marsa47

    Hi, I think I faced the exact same problem and brute-force solved it by deleting corrupt settings.

    Here's what I found. A few weeks ago I tinkered with custom gradient creation (Gradient editor window -> edit this gradient).

    I didn't need the gradients function for a while, but when I eventually tried to use it again, I found that whenever I tried to access the "Gradient editor" window (via the Fill or Gradient tools), the "Gradient editor" window would flash briefly with what seemed to be the last settings I used in the past (noise gradients), and then the program crashes.

    Because of this, the gradient was impossible to customize.

    At this point I thought there were broken settings. I downloaded a fresh copy of the program, and of course it was working fine. I compared the fresh "PhotoDemon_settings.xml" with the one from my old installation. Nothing remotely related to gradients there.

    Then I went through the program directories and found that settings for many tools are stored in separate XML files in the "PhotoDemon Directory\Data\Presets" directory.

    I deleted the "dialog_GradientEditor.xml" file. Problem solved, the program doesn't crash anymore. I guess there were some corrupt settings.

    Unfortunately, I can't provide the corrupt file for examination, since I deleted it. I suggest @rcchadburn keep his corrupt copy of the settings file and provide it to the dev, if requested.

    TLDR: Delete the corrupt settings file for the Gradient editor, located at:
    PhotoDemon Directory\Data\Presets\dialog_GradientEditor.xml

  5. tannerhelland commented on Jan 26, 2026

    @tannerhelland
    Owner

    Thank you for sharing your experience, @marsa47 ! This gives me something concrete to investigate.

    (I tried and failed to replicate the original bug report, and a lack of follow-up information made it hard for me to continue.)

    I will write some new tests against the gradient editor storage file, and see if I can solve this problem once and for all.

    If you do encounter another problem with the gradient tool, please share your \Data\Presets\dialog_GradientEditor.xml file here. Thank you!

  6. tannerhelland commented on Jan 26, 2026

    @tannerhelland
    Owner

    I've just pushed a new nightly build with fixes for a potential crash when the gradient dialog is first loaded, if the last-used settings involved a noise gradient. Thank you to @marsa47 for pointing me in this direction! If you encounter any other problems with the gradient tool, please let me know and I'll dive deeper.

  7. marsa47 commented on Jan 27, 2026

    @marsa47

    Great news, looks like you solved the problem!

    For testing purposes (on 2025.12), yesterday I played around with all the settings in the "noise gradient" tab, then went back to the image and applied the customized gradient (up to that point, everything was OK). But when I clicked the Gradient tool on the toolbar again, the program crashed. As you pointed out, it looks like the last-used "noise gradient" tab was the culprit.

    At that point I once again had a "broken" dialog_GradientEditor.xml, so I could test it with the latest nightly build. I downloaded a fresh install (2026.1 alpha, build 68) and transplanted the corrupt settings. This time, the program does not crash, and the gradient settings load correctly, including noise gradients.

  8. added
    help needed
    and removed on Jan 27, 2026
  9. tannerhelland commented on Jan 27, 2026

    @tannerhelland
    Owner

    Thank you so much for the follow-up information, @marsa47 ! I'm happy the fix worked. I'm sorry I didn't find and fix this problem sooner.

    @rcchadburn - in my estimation, your original crash still seems most likely to be a memory limitation. I am going to close this issue for now as the most pressing (and repeatable) issue has been solved, but if you can return and help me do additional testing on your situation, I would love to re-open the issue and investigate further. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help neededpostponed indefinitelyunconfirmed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions