@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)
@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)