Orphaned meta image files

A client of mine ended up with a page which was suddenly not visible anymore in the panel.It seems he tried to upload an image twice until he got this error message:

However, I could find the page on the server (thanks Kirby). In the folder I found 4 additional image.txt files with a tmp-string like:

  • image-1.tmp-6a315a81a64fd.webp.de.txt

containing only a UUID. Two of them were “fine” but the other two were causing that the page couldn’t show up anymore in the panel. Deleting of course helped. When those orphaned files where still present the panel showed the following at the page sit:

For me this is fixed for now as long as it doesn’t happen regularly. Just wanted to report in case that’s a deeper bug anywhere.

I did some more testing. It’s not the same “tmp-string”-bug but it might be related:

The uploaded images get transformed e.g. from png to webp. If I upload the same image again I get the error message that the .webp already exists on the server. However the png is now uploaded to the page folder. And therefore the webp.txt is deleted. Ending up with two images (png, webp) and no .txt file anymore.

How are you handling the webp conversion? It sounds like you are getting the webp files generated in the content folder rather then as file version in the media folder. if you are still using my webp plugin with recent versions of Kirby, it is no longer needed as Kirby now has builtin support for webp images. You can use thumb(0 in your templates and set the format option to webp.

I let Kirby directly create a webp version on upload. I found also some other tickets and forum entries about the same or at least very similar issues (see Perform file manipulations on upload inside temp dir, not content root · Issue #7301 · getkirby/kirby · GitHub).