LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-16-2014, 10:41 PM   #1
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Rep: Reputation: 29
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
 
Old 01-16-2014, 11:08 PM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,861
Blog Entries: 36

Rep: Reputation: 459Reputation: 459Reputation: 459Reputation: 459Reputation: 459
Code:
du -s *
Will tell you the size of the whole directory all files combined.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Disk/physical size more than virtual size - qcow2 image toshko3 Linux - Virtualization and Cloud 12 12-18-2012 03:16 AM
Shell script to find a file size sharincharles Linux - Newbie 10 06-20-2011 01:06 PM
[SOLVED] xsane reduces size of image of scanned page - how to get back to full size? taylorkh Linux - Software 7 11-12-2010 04:37 PM
What is the easiest way to increase the size of a Xen Image made from an image? abefroman Linux - Software 4 12-14-2009 10:11 PM
A bash script to find duplicate image files fotoguy Programming 7 01-25-2007 06:47 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration