Skip to content

Failed thumb generation can leave a temp file behind in the content folder #8374

Description

@afbora

@afbora @bastianallgeier One edge case I noticed: the catch (Throwable $e) cleanup won't run if process() is killed by a PHP memory_limit or max_execution_time fatal error, since those aren't catchable. In that case $tempRoot is left behind for good. I've seen this happen with a large create resize (e.g. 2500×2500) on high-megapixel uploads. The leftover file then also shows up as a stray file in the folder, and Kirby can no longer tell which template/blueprint it belongs to.

Maybe it would help to write the temp file to a separate folder instead of next to the original, so it can't be mistaken for a real content file even if it's not cleaned up.

Originally posted by @ennemoserandre in #8074 (comment)

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions