[SCRIPT] FOG tools
-
That is super sweet.
-
Now that we know we can change compression settings post-upload,
Would it make sense to always upload with compression set at 0 and then compress server-side afterwards?
Then, we wouldn’t need FTP client side to move images from /images/dev to /images because after compression completes, the image could be moved?
Maybe even a progress bar for the compression progress could be displayed under “Tasks” ?
-
@Wayne-Workman said:
Then, we wouldn’t need FTP client side to move images from /images/dev to /images because after compression completes, the image could be moved?
Depends the server performance, if you have multiple uploads you will have a high cpu utilization.
-
Updated :
- Correct rights problem on new imgs
- Adding progression bar using PV
With progression :
######################################################### # FOG Images tools # ######################################################### Changing compression of MASTER_WB from 0 to 5 : Backup img...Done Compress new img...In progress 24,2MO 0:00:00 [ 78MB/s] [=======================================================>] 100% 73,3GO 0:18:12 [68,7MB/s] [=======================================================>] 100% 37,5GO 0:09:58 [64,1MB/s] [=======================================================>] 100% 5,1kO 0:00:00 [ 394kB/s] [=======================================================>] 100% 142MO 0:00:00 [ 163MB/s] [=======================================================>] 100% Compress new img...Done Remove backups...Done Update database...Done Exiting...
The size isn’t the compressed size, but size before.
-
I would think multiple uploads would be an edge case I would love to have this as a feature especially if it could compress a temp copy so you could deploy immediately.
-
@Joseph-Hales said:
I would think multiple uploads would be an edge case I would love to have this as a feature especially if it could compress a temp copy so you could deploy immediately.
Well, I suppose the uncompressed copy could serve as the “temp” copy.
And, I suppose FTP could go ahead and just move that over from /dev to /images like normal
and in the background, the server could compress the /images image to /dev and when it’s done (and waiting for active tasks for that image to complete), it could replace it with the compressed copy?
-
That would be perfect.
-
I think this is easily accomplished.
Using Ch3i’s script for compression, and making that automated, and scheduling a Cron task on the server to run that script every hour or so should do the trick.
The script will need a default compression set, and it’ll need to check the DB for any images that aren’t set to that default (say, compression 1). Then, it would check to see if that image exists in it’s storage node, if so, recompress it to /node/dev , and then check the DB if there are active tasks associated with that image… and just wait till they get done, then replace the old image with the new.
I think I can do this, I’ll try tonight or tomorrow night.
-
@Wayne-Workman said:
I think I can do this, I’ll try tonight or tomorrow night.
Didn’t get to this tonight… passed out straight away after work. It was a long and tough day.
And my laptop is acting up… I replaced the fan in it yesterday and the fan was literally the very last component I could take out of the plastic frame… I think I’m going to have to open it up again and re-do the thermal compound, might have used too much. It’s the worst designed laptop I’ve ever seen… It’s like they wanted to make cleaning/replacing the fan & radiator as difficult as possible. -
Bumping this thread.