@jess avatar
UTC

Petty Tyrant
0:7 And counting
Joined: UTC
Posts: 37987
Location: Bay Area, California
 
Petty Tyrant
@jess avatar
0:7 And counting
Joined: UTC
Posts: 37987
Location: Bay Area, California
UTC quote
mike_bike_kite wrote:
jess wrote:
In general, I support the use of uploading to MV. I'd rather have the pictures here, attached to the thread, so that they will always remain. Too often, when stuff is linked from elsewhere, those links go stale. We've all seen it in other forums, lots of missing pictures with little Xs or ?s where the photo should be.

Space is finite, though, which is why there's an upload limit in place. 40MB is a lot, though, and we're already way oversold, when you consider how much space 40mb times our number of users works out to.
Couldn't you just search the directory for images that are over a certain size (say 100k) or where the dimensions are greater than 350*350 pixels and then just process them down to a more manageable size? You'd keep the same name so the links all work. If an image hasn't been viewed for a long time then perhaps it could be reduced still further.
I have done so at various points in the past. All the images are in a single directory, though, and so uploading and downloading it en masse is a bit problematic, what with four gazillion attachments. Also, there's the issue of knowing which ones have already been compressed so as not to re-compress them.

Ultimately, the right solution is to have the upload mechanism process each photo as its uploaded in order to maximize space. I've been working toward that goal for a while now. In the mean time, I've set the upload quota -- 40mb -- high enough so that most people won't run into it.
@alice avatar
UTC

Molto Verboso
ET4
Joined: UTC
Posts: 1681
Location: Southern California
 
Molto Verboso
@alice avatar
ET4
Joined: UTC
Posts: 1681
Location: Southern California
UTC quote
jimc wrote:
<splutter>
You guys nearly cost me a new keyboard! Nerd emoticon

Who's got the MV screen cleaner?
Razz emoticon Laughing emoticon
@rgconner avatar
UTC

Ossessionato
GTS250
Joined: UTC
Posts: 2959
 
Ossessionato
@rgconner avatar
GTS250
Joined: UTC
Posts: 2959
UTC quote
jimc wrote:
WTF is 40MD?
it is the International Bureau of Weights and Measures new metric for measuring boorish behavior:

MegaDicks.

Conversion table

1 MegaDick =

.75 Frenchmen
1.25 Drunk Englishman
1.0 American Tourist
.63 Texan
.33 Texan Tourist
.1 Anonymous Internet Poster




Clown emoticon
@mike_bike_kite avatar
UTC

Banned
GTS250 - GT200 - XJR1300
Joined: UTC
Posts: 1424
Location: SW London, UK
 
Banned
@mike_bike_kite avatar
GTS250 - GT200 - XJR1300
Joined: UTC
Posts: 1424
Location: SW London, UK
UTC quote
jess wrote:
I have done so at various points in the past. All the images are in a single directory, though, and so uploading and downloading it en masse is a bit problematic, what with four gazillion attachments. Also, there's the issue of knowing which ones have already been compressed so as not to re-compress them.
I'm guessing the pictures are in a unix directory: list files in size order just keeping the top 40 each time. Run command to compress each file in turn. Sleep for 30 mins. Then just leave it running for ever more. If there are no files then it just sleeps. You could do a similar type of things for where the x or y dimensions of the image are greater than 350 for example. I had a guess at the following code but I've never used the convert command myself.
#!/bin/sh

#       convert is a part of ImageMagick.
#       program ignores files under 100k
#       I'm just guessing with this code
#       don't test it on your main directory!!!

cd your_img_dir

for f in `find . -size +100k -print | egrep -i "(gif|jpg)" | head -40`
do
        time=`date '+%Y%m%d %H:%M'`
        echo "$time Processing $f at "

        convert -resize '350x350!' $f tmp_file

        mv tmp_file $f
done

exit
@jimc avatar
UTC

Moderaptor
The Hornet (GT200, aka Love Bug) and 'Dimples' - a GTS 300
Joined: UTC
Posts: 44406
Location: Pleasant Hill, CA
 
Moderaptor
@jimc avatar
The Hornet (GT200, aka Love Bug) and 'Dimples' - a GTS 300
Joined: UTC
Posts: 44406
Location: Pleasant Hill, CA
UTC quote
Does the convert routine preserve aspect ratio?
@jess avatar
UTC

Petty Tyrant
0:7 And counting
Joined: UTC
Posts: 37987
Location: Bay Area, California
 
Petty Tyrant
@jess avatar
0:7 And counting
Joined: UTC
Posts: 37987
Location: Bay Area, California
UTC quote
mike_bike_kite wrote:
jess wrote:
I have done so at various points in the past. All the images are in a single directory, though, and so uploading and downloading it en masse is a bit problematic, what with four gazillion attachments. Also, there's the issue of knowing which ones have already been compressed so as not to re-compress them.
I'm guessing the pictures are in a unix directory: list files in size order just keeping the top 40 each time. Run command to compress each file in turn. Sleep for 30 mins. Then just leave it running for ever more. If there are no files then it just sleeps. You could do a similar type of things for where the x or y dimensions of the image are greater than 350 for example. I had a guess at the following code but I've never used the convert command myself.
#!/bin/sh

#       convert is a part of ImageMagick.
#       program ignores files under 100k
#       I'm just guessing with this code
#       don't test it on your main directory!!!

cd your_img_dir

for f in `find . -size +100k -print | egrep -i "(gif|jpg)" | head -40`
do
        time=`date '+%Y%m%d %H:%M'`
        echo "$time Processing $f at "

        convert -resize '350x350!' $f tmp_file

        mv tmp_file $f
done

exit
This is a good and useful script, and I may very well use it for the mass of older uploads. Unfortunately, it doesn't help the person who uploaded the file being reduced, as their quota is tracked separately. They won't get credit for the reduced file size, in other words.

Even though the uploads folder is huge at this point, I'm not running out of space... yet. Just trying to keep it manageable.

The ultimate goal is to reduce each file to an acceptable level as they are uploaded to the system.
@judy avatar
UTC

World Traveler
2007 LX150 Daring Plum Leonardo Da Vespa
Joined: UTC
Posts: 29303
 
World Traveler
@judy avatar
2007 LX150 Daring Plum Leonardo Da Vespa
Joined: UTC
Posts: 29303
UTC quote
JIMC
UTC

Addicted
Joined: UTC
Posts: 920
Location: Linnville, TX
 
Addicted
Joined: UTC
Posts: 920
Location: Linnville, TX
UTC quote
rgconner wrote:
it is the International Bureau of Weights and Measures new metric for measuring boorish behavior:

MegaDicks.

Conversion table

1 MegaDick =

.75 Frenchmen
1.25 Drunk Englishman
1.0 American Tourist
.63 Texan
.33 Texan Tourist
.1 Anonymous Internet Poster




Clown emoticon
So Texans are less annoying when they are tourists and also less annoying then the avg American tourist?
@jess avatar
UTC

Petty Tyrant
0:7 And counting
Joined: UTC
Posts: 37987
Location: Bay Area, California
 
Petty Tyrant
@jess avatar
0:7 And counting
Joined: UTC
Posts: 37987
Location: Bay Area, California
UTC quote
HonestlyLincoln wrote:
So Texans are less annoying when they are tourists and also less annoying then the avg American tourist?
I believe you're reversing the intended direction. It only takes .33 Texan Tourists to make 1 MegaDick. By the same equation, one Texan Tourist == 3 MegaDicks.

Or something.

/lived in Texas once, don't shoot the messenger
⚠️ Last edited by jess on UTC; edited 1 time
@jess avatar
UTC

Petty Tyrant
0:7 And counting
Joined: UTC
Posts: 37987
Location: Bay Area, California
 
Petty Tyrant
@jess avatar
0:7 And counting
Joined: UTC
Posts: 37987
Location: Bay Area, California
UTC quote
Also, judging by the conversion table, I'd say it was invented by a drunken Englishman.
UTC

Addicted
Joined: UTC
Posts: 920
Location: Linnville, TX
 
Addicted
Joined: UTC
Posts: 920
Location: Linnville, TX
UTC quote
Ok, I get it now.... I am bad at math.

And a MegaDick times 3.
@techguy avatar
UTC

Ossessionato
Kymco P250 Now, P200E in the 80's
Joined: UTC
Posts: 3908
Location: Antelope, CA, USA
 
Ossessionato
@techguy avatar
Kymco P250 Now, P200E in the 80's
Joined: UTC
Posts: 3908
Location: Antelope, CA, USA
UTC quote
Jim seemed to enjoy the jokes.. the as to why... I'll leave to your imaginations

Jim,

I enjoy your comments and sense of humor and if you're considered grumpy for it, then they just don't get it. I guess I can see the world through the same "glasses" as you wear, at times.

Keep up the good work.
@mike_bike_kite avatar
UTC

Banned
GTS250 - GT200 - XJR1300
Joined: UTC
Posts: 1424
Location: SW London, UK
 
Banned
@mike_bike_kite avatar
GTS250 - GT200 - XJR1300
Joined: UTC
Posts: 1424
Location: SW London, UK
UTC quote
jimc wrote:
Does the convert routine preserve aspect ratio?
I think it does if I read the man page correctly (I believe that's what the ! in the convert code means) but I haven't tried it so I really don't know for sure
@rgconner avatar
UTC

Ossessionato
GTS250
Joined: UTC
Posts: 2959
 
Ossessionato
@rgconner avatar
GTS250
Joined: UTC
Posts: 2959
UTC quote
jess wrote:
Also, judging by the conversion table, I'd say it was invented by a drunken Englishman.
I resent that! I am IRISH!




(actually, I am typical American Mutt, I just have an Irish last name)
@rgconner avatar
UTC

Ossessionato
GTS250
Joined: UTC
Posts: 2959
 
Ossessionato
@rgconner avatar
GTS250
Joined: UTC
Posts: 2959
UTC quote
[quote="jess"]
mike_bike_kite wrote:
*SNIP*
jess wrote:
*SNIP*
One line:

find . -size +100k \( -name "*jpg" -name -o -name "*.gif" \) -exec convert -resize '350x350!' {} tmp_file \; -exec mv tmp_file {} \;

you might want to throw in a -f if want to make sure it is a regular file, and -prune if you don't want to decend into subdirs.

UNIX: More than one way to fsck yourself
@rgconner avatar
UTC

Ossessionato
GTS250
Joined: UTC
Posts: 2959
 
Ossessionato
@rgconner avatar
GTS250
Joined: UTC
Posts: 2959
UTC quote
One more trick:

the most useful command in unix is "du -s * | sort -n"

Gives the filenames and sizes for the files under the current directory, smallest to largest.
DoubleGood Design banner

Modern Vespa is the premier site for modern Vespa and Piaggio scooters. Vespa GTS300, GTS250, GTV, GT200, LX150, LXS, ET4, ET2, MP3, Fuoco, Elettrica and more.

Buy Me A Coffee
 

Shop on Amazon with Modern Vespa

Modern Vespa is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com


All Content Copyright 2005-2025 by Modern Vespa.
All Rights Reserved.


[ Time: 0.0246s ][ Queries: 3 (0.0121s) ][ live ][ 318 ][ ThingOne ]