LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Script snippet to find the size of an image. (https://www.linuxquestions.org/questions/programming-9/script-snippet-to-find-the-size-of-an-image-4175491557/)

Dafydd 01-16-2014 10:41 PM

Script snippet to find the size of an image.
 
I need to write a script that will copy image files to a DVD from an online website I own. The script I can write, whats giving me problems is a bash code snippet that tells me the size of a gif, png, jpg, etc. I can find: upsize, downsize, resize, but no sizof.

As I down load, I want to copy them into directories of between 4 and 4.5 gigs. This will make it easier to burn if they are already broken down into size groups. I didn't find anything in ImageMagick and haven't looked into FFmpeg yet.

Some thought? Directions?
Dave
Never mind
If you look long enough you will find the answer even in a 5 year old thread.
Code:

dave@Dafydd:~$ s=$(stat -c %s whitehorse.jpg)
dave@Dafydd:~$ echo $s
24757
dave@Dafydd:~$ s=$(stat -c %s waiting-train.flv)
dave@Dafydd:~$ echo $s
7102973


sag47 01-16-2014 11:08 PM

Code:

du -s *
Will tell you the size of the whole directory all files combined.


All times are GMT -5. The time now is 07:23 PM.