Fixed Rebuilding Media Ithem Thumbnails required huge amouts of temporary diskspace

Kirby

Well-known member
Affected version
XFMG 2.1.0 Preview 1
This is probably working as designed, but if that is the case the design IMHO isn't exactly that great ;)

When rebuilding media item thumbnails, \XFMG\Repository\Media::rebuildImageThumb() copies the full size image to a temporary file, but does not clean up this temporary file.

This isn't a problem per se as the garbage collector built into \XF\Util\File automatically cleans them up when the script terminates.
But if this is used from CLI, all those temporary files will stay until all thumbnails are rebuilt which can cause the temporary folder to grow to a significant size.

It would be nice if this could be changed to immediately clean up the temporary files after the image has been loaded.
 
Thing is, we don't actually have any CLI commands which rebuild media or album (or attachment) thumbnails so it's really a moot point.

Nonetheless we'll call \XF\Util\File::cleanUpTempFiles(); before returning resume in all three of those cases starting with the next 2.0/2.1 releases.
 
Thank you for reporting this issue. The issue is now resolved and we are aiming to include that in a future XFMG release (2.0.6).

Change log:
Tidy up temp files manually when rebuilding thumbnails at the end of each batch.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Thing is, we don't actually have any CLI commands which rebuild media or album (or attachment) thumbnails so it's really a moot point.
Not directly, but indirectly ;)

There is a CLI command to finalize an import, and if this import triggers those rebuild jobs they will run in CLI.

Thanks for adressing this!
 
Last edited:
Back
Top Bottom