Project

General

Profile

Actions

Feature #98664

closed

Command for clearing processed files

Added by Julian Hofmann almost 2 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
CLI
Target version:
-
Start date:
2022-10-20
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Maybe it would be nice to have the possibility of clearing processed files via commandline.

Background:
In a tweet by Jousch, he was asking whether someone uses his toolbar-based clearing of processed files (josefglatz/toolbar-clear-processedfiles) anymore. After some discussion why such a feature should not be available for editor and/or in production, the was the question if it would be useful as a command (and in the core)


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #45039: Scheduler task to clean up unused processed imagesClosed2013-01-31

Actions
Related to TYPO3 Core - Task #102582: Command cleanup:localprocessedfiles should be able to cleanup all recordsClosed2023-12-01

Actions
Actions #1

Updated by Josef Glatz almost 2 years ago

my use cases so far (were the functionality would also be ok as command)

  • You're changing from ImageMagick to GraphicsMagick for any reason or just for testing
  • You're developing cache clearing features and you need a quick way to clear processed files before doing another testrun locally
  • You're just lazy and don't want to open the system tools all the time
  • You're experimenting with the GFX/jpeg_quality. And yes it totally makes sense to play with the value even if every photographer know that value 86 is somehow a good value between big file size and quality.
Actions #2

Updated by Georg Ringer 4 months ago

  • Sprint Focus set to Needs Decision
Actions #3

Updated by Garvin Hicking 4 months ago

  • Category set to CLI
Actions #4

Updated by Garvin Hicking 4 months ago

  • Related to Feature #45039: Scheduler task to clean up unused processed images added
Actions #5

Updated by Garvin Hicking 4 months ago

  • Status changed from New to Closed

I believe ./bin/typo3 cleanup:localprocessedfiles is the command that could do that already?

If I misunderstood something here, please let me know and I can re-open the issue or discuss it!

Actions #6

Updated by Julian Hofmann 4 months ago

Use-case and funcionallity would be another one.

./bin/typo3 cleanup:localprocessedfiles

The command will delete sys_file_processedfile records with references to non-existing files. Also, files in the configured temporary directory (typically processed) will be deleted if there are no references to them.

(https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.3/Feature-45039-CommandToCleanUpLocalProcessedFiles.html)

However, our use case would be that processed files are deleted independently of existing relations or (non-)existing original files. And that the database is also cleaned up in the process.
This can be helpful if something is changed in the image processing. E.g. (as Jousch described) switching from ImageMagick to GraphicsMagick, but also more creative scenarios such as a general switch to webp or similar, whereby all processed files are to be recreated.

Actions #7

Updated by Garvin Hicking 4 months ago

  • Status changed from Closed to Needs Feedback

Of course, I see - I actually misremembered. I once patched that command to do my bidding and thought it was part of the Core.

But I guess this command could be the base of such an addition, adding a parameter like "--reset" (that's what I used)...

Actions #8

Updated by Garvin Hicking 4 months ago

Hi!

Turns out I did contribute this. If I'm not totally brainfogged, have you checked this out:

https://github.com/TYPO3/typo3/commit/141e8fd4d835e49ac3379d9827b7eab36b0a573b

Actions #9

Updated by Julian Hofmann 4 months ago

Oh, I haven't seen that yet. Yes, from reading it, that should solve the problem.

Thanks for taking care of it (and solving it)!

Actions #10

Updated by Garvin Hicking 4 months ago

  • Status changed from Needs Feedback to Closed
  • Sprint Focus deleted (Needs Decision)

Thank you and sorry for me not properly "getting it" in first place. Hope it's ok to close the issue here now?

Actions #11

Updated by Garvin Hicking 4 months ago

  • Related to Task #102582: Command cleanup:localprocessedfiles should be able to cleanup all records added
Actions

Also available in: Atom PDF