resize pictures received by mailserver

2012-06-13 Thread Randall

hi all,

have a question, not really debian specific, but looking for the tools 
available in debian to do the job.


as follows:

i'm trying to set up a private synchronised  mailinglist/forum. 
(thinking of a combination of mailman and tiki forum) and i want to 
avoid having huge pictures showing up on the mailinglist/forum, since 
most receivers have slow connections with huge latency etc...


one option would be to set a restriction on received sizes and do some 
training of the users sending the mails and the harmonizing the mail 
clients used etc
but nowadys everybody uses different mobile devices etc.. to take and 
send the pictures.


taking this approach will turn me into a hated drill sergeant... not my 
favorite job..



so i figured there should be a way of less social resistance and more 
user comfort.


is it possible to have all messages received by the mailinglists MTA 
scanned for pictures and have these automatically scaled to a default 
size before its being redistributed to the receivers on the mailinglist 
and subsequently the forum.



my idea was that it could basically follow the same route as spam/virus 
scanners, but i can't seem to find any available tools for this, never 
came across it by accident or my googling skills are lacking.


anybody a hint?

much obliged



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4fd86f39.40...@songshu.org



Re: resize pictures received by mailserver

2012-06-13 Thread Ralf Mardorf
Half OT: Modern MUAs usually support options how to handle pictures.
Evolution for example provides
- Never load images from the Internet
- Load images only in messages from contacts
- Always load images from the Internet
If your mailing list/forum should be for photograph or something
similar, people might prefer original pics, instead of formated pics. If
pics are unimportant or less important, than I would add restrictions to
the allowed formats and sizes and ban anything else.
I don't see the need that it's your task to take care about the
bandwidth of the Internet connections the users have got, this is the
task of their MUAs. IMO you only should care about the traffic for your
servers, especially if people upload pics to your forum, just to link
from their own homepages to those pics, to avoid traffic for their
websides.

- Ralf


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1339585945.3485.88.camel@precise



Re: resize pictures received by mailserver

2012-06-13 Thread Lars Noodén
I'm not sure it would be a good idea to try to use mail as a surrogate
for a file system, especially not a mailing list.   You could use MIME
Defang to strip the attachments, but it has other capabilities, too:

http://www.mimedefang.org/faq


/Lars


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4fd8766e.4020...@gmail.com



Re: resize pictures received by mailserver

2012-06-13 Thread Randall

On 06/13/2012 01:12 PM, Ralf Mardorf wrote:
thanks for the input:


Half OT: Modern MUAs usually support options how to handle pictures.
Evolution for example provides
- Never load images from the Internet
- Load images only in messages from contacts
- Always load images from the Internet


in my case the pictures are important and should always be shown, 
blocking them renders the message itself useless



If your mailing list/forum should be for photograph or something
similar, people might prefer original pics, instead of formated pics. If
pics are unimportant or less important, than I would add restrictions to
the allowed formats and sizes and ban anything else.


the pictures are important, but not the quality of the pictures itself. 
(its about pictures of waste paper and plastic's, not family holiday 
snapshots)



I don't see the need that it's your task to take care about the
bandwidth of the Internet connections the users have got, this is the
task of their MUAs. IMO you only should care about the traffic for your
servers, especially if people upload pics to your forum, just to link
from their own homepages to those pics, to avoid traffic for their
websides.


it is my task, as i said its not a public service but a private service, 
have more then enough bandwidth and cpu cycles to spare on my side, i 
know the end users who don't (my colleagues on different continents) and 
a good and usable result matters to me




- Ralf





--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4fd884b9.90...@songshu.org



Re: resize pictures received by mailserver

2012-06-13 Thread Randall

On 06/13/2012 01:15 PM, Lars Noodén wrote:

I'm not sure it would be a good idea to try to use mail as a surrogate
for a file system, especially not a mailing list.   You could use MIME
Defang to strip the attachments, but it has other capabilities, too:

http://www.mimedefang.org/faq


/Lars




thanks,

this seems to be heading in the direction i'm looking for, or at least 
95% of what i need.


p.s.
using mail does have its benefits, its a well tested and build in option 
in most devices that is platform independent and fairly secure, easy to 
use and integrate.


its not a file system, just the transfer and filing method

but that's just my 2 cents


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4fd88932.3090...@songshu.org



Re: resize pictures received by mailserver

2012-06-13 Thread Tony van der Hoff
On 13/06/12 12:45, Randall wrote:
> hi all,
> 
> have a question, not really debian specific, but looking for the tools
> available in debian to do the job.
> 
> as follows:
> 
> i'm trying to set up a private synchronised  mailinglist/forum.
> (thinking of a combination of mailman and tiki forum) and i want to
> avoid having huge pictures showing up on the mailinglist/forum, since
> most receivers have slow connections with huge latency etc...
> 
> one option would be to set a restriction on received sizes and do some
> training of the users sending the mails and the harmonizing the mail
> clients used etc
> but nowadys everybody uses different mobile devices etc.. to take and
> send the pictures.
> 
> taking this approach will turn me into a hated drill sergeant... not my
> favorite job..
> 
> 
> so i figured there should be a way of less social resistance and more
> user comfort.
> 
> is it possible to have all messages received by the mailinglists MTA
> scanned for pictures and have these automatically scaled to a default
> size before its being redistributed to the receivers on the mailinglist
> and subsequently the forum.
> 
> 
> my idea was that it could basically follow the same route as spam/virus
> scanners, but i can't seem to find any available tools for this, never
> came across it by accident or my googling skills are lacking.
> 
> anybody a hint?
> 
> much obliged
> 

I use a combination of cjpeg, djpeg, and pnmscale to handle this.
Here is a snippet of PHP. Excuse the wrapping.

if ( !move_uploaded_file( $file['tmp_name'], $filename.".jpg" ) )
trigger_error( "Possible file upload attack. File ".$file['name'] );
if ( system( "/usr/local/bin/djpeg ".$filename.".jpg > ".$filename.".pnm
2>> ../errlog.txt" ) == "FALSE" )
trigger_error( "failed to decompress ".$filename.".jpg" );
if ( system( "/usr/local/bin/pnmscale -xysize 110 140 ".$filename.".pnm
> ".$filename."1.pnm 2>> ../errlog.txt" ) == "FALSE" )
trigger_error( "failed to scale ".$filename.".pnm" );
if ( system( "/usr/local/bin/cjpeg -smooth 10 -qual 50
".$filename."1.pnm > ./images/users/".$userid.".jpg 2>> ../errlog.txt" )
== "FALSE" )
trigger_error( "failed to compress ".$filename."1.pnm" 
);



-- 
Tony van der Hoff  | mailto:t...@vanderhoff.org
Ariège, France |


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4fd88959.7090...@vanderhoff.org



Re: resize pictures received by mailserver

2012-06-13 Thread Randall

On 06/13/2012 02:36 PM, Tony van der Hoff wrote:

On 13/06/12 12:45, Randall wrote:

hi all,

have a question, not really debian specific, but looking for the tools
available in debian to do the job.

as follows:

i'm trying to set up a private synchronised  mailinglist/forum.
(thinking of a combination of mailman and tiki forum) and i want to
avoid having huge pictures showing up on the mailinglist/forum, since
most receivers have slow connections with huge latency etc...

one option would be to set a restriction on received sizes and do some
training of the users sending the mails and the harmonizing the mail
clients used etc
but nowadys everybody uses different mobile devices etc.. to take and
send the pictures.

taking this approach will turn me into a hated drill sergeant... not my
favorite job..


so i figured there should be a way of less social resistance and more
user comfort.

is it possible to have all messages received by the mailinglists MTA
scanned for pictures and have these automatically scaled to a default
size before its being redistributed to the receivers on the mailinglist
and subsequently the forum.


my idea was that it could basically follow the same route as spam/virus
scanners, but i can't seem to find any available tools for this, never
came across it by accident or my googling skills are lacking.

anybody a hint?

much obliged


I use a combination of cjpeg, djpeg, and pnmscale to handle this.
Here is a snippet of PHP. Excuse the wrapping.

if ( !move_uploaded_file( $file['tmp_name'], $filename.".jpg" ) )
trigger_error( "Possible file upload attack. File ".$file['name'] );
if ( system( "/usr/local/bin/djpeg ".$filename.".jpg>  ".$filename.".pnm
2>>  ../errlog.txt" ) == "FALSE" )
trigger_error( "failed to decompress ".$filename.".jpg" );
if ( system( "/usr/local/bin/pnmscale -xysize 110 140 ".$filename.".pnm

".$filename."1.pnm 2>>  ../errlog.txt" ) == "FALSE" )

trigger_error( "failed to scale ".$filename.".pnm" );
if ( system( "/usr/local/bin/cjpeg -smooth 10 -qual 50
".$filename."1.pnm>  ./images/users/".$userid.".jpg 2>>  ../errlog.txt" )
== "FALSE" )
trigger_error( "failed to compress ".$filename."1.pnm" 
);





thanks,
could be a very usable piece of code.
this would be called when uploading pictures to a website i assume?



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4fd88cc9.9070...@songshu.org



Re: resize pictures received by mailserver

2012-06-13 Thread Rob Owens
On Wed, Jun 13, 2012 at 12:45:13PM +0200, Randall wrote:
> 
> is it possible to have all messages received by the mailinglists MTA
> scanned for pictures and have these automatically scaled to a
> default size before its being redistributed to the receivers on the
> mailinglist and subsequently the forum.
> 
craigslist.org seems to do this when you upload pictures of the item
you're selling.  I'm not sure how they do it, but I imagine they use the
mogrify command from imagemagick:

mogrify -resize 800x600 somefile.jpg

This will overwrite the original somefile.jpg with an 800x600 version of
somefile.jpg

This gets tricky, because what if the original is taller than it is
wide?  The above command will distort the image.

You can also:

mogrify -resize 30% somefile.jpg

This gives you the correct aspect ratio every time, but what if the
original image was already small?

Anyway, some food for thought.

-Rob


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120613174720.ga23...@aurora.owens.net



Re: resize pictures received by mailserver

2012-06-13 Thread Ralf Mardorf
On Wed, 2012-06-13 at 13:47 -0400, Rob Owens wrote:
> The above command will distort the image.

Unproportional scaled pics are common, but they are a PITA!


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1339610613.8093.28.camel@precise



Re: resize pictures received by mailserver

2012-06-13 Thread Christofer C. Bell
On Wed, Jun 13, 2012 at 12:47 PM, Rob Owens  wrote:
> On Wed, Jun 13, 2012 at 12:45:13PM +0200, Randall wrote:
>>
>> is it possible to have all messages received by the mailinglists MTA
>> scanned for pictures and have these automatically scaled to a
>> default size before its being redistributed to the receivers on the
>> mailinglist and subsequently the forum.
>>
> craigslist.org seems to do this when you upload pictures of the item
> you're selling.  I'm not sure how they do it, but I imagine they use the
> mogrify command from imagemagick:
>
> mogrify -resize 800x600 somefile.jpg
>
> This will overwrite the original somefile.jpg with an 800x600 version of
> somefile.jpg
>
> This gets tricky, because what if the original is taller than it is
> wide?  The above command will distort the image.
>
> You can also:
>
> mogrify -resize 30% somefile.jpg
>
> This gives you the correct aspect ratio every time, but what if the
> original image was already small?
>
> Anyway, some food for thought.

The ImageMagick "identify" command could be used on the image to
gather statistics (such as pixel size) do some math on it, and feed
that back to mogrify, giving you some consistency in output.

Example:

cbell@circe:~$ identify testimage.jpg
testimage.jpg JPEG 4752x3168 4752x3168+0+0 8-bit DirectClass 5.706MB
0.000u 0:00.000
cbell@circe:~$

Grab field 3, do some math to determine aspect ratio, compare the
current resolution against your target, figure out the new size for
the image, feed that back to mogrify to resize it correctly.

Want something smaller than 800x600?

In the above, the image is 4752 x 3168.  We want the image to be
smaller than 800x600.  We need to decrease the image size by the
larger of 4752/800 or 3168/600.  These are 5.28 and 5.94 respectively.
 So we need to decrease the image to 16.8% of its current size
(1/5.94).

cbell@circe:~$ mogrify -resize 16.8% testimage.jpg
cbell@circe:~$ identify testimage.jpg
testimage.jpg JPEG 798x532 798x532+0+0 8-bit DirectClass 239KB 0.000u 0:00.010
cbell@circe:~$

Goal achieved.

-- 
Chris


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CAOEVnYs-R�UzbkdQtRQpD8Xn_uGFE=qus5f+txaajovjr...@mail.gmail.com



Re: resize pictures received by mailserver

2012-06-13 Thread Kushal Kumaran
On Wed, Jun 13, 2012 at 11:17 PM, Rob Owens  wrote:
> On Wed, Jun 13, 2012 at 12:45:13PM +0200, Randall wrote:
>>
>> is it possible to have all messages received by the mailinglists MTA
>> scanned for pictures and have these automatically scaled to a
>> default size before its being redistributed to the receivers on the
>> mailinglist and subsequently the forum.
>>
> craigslist.org seems to do this when you upload pictures of the item
> you're selling.  I'm not sure how they do it, but I imagine they use the
> mogrify command from imagemagick:
>
> mogrify -resize 800x600 somefile.jpg
>
> This will overwrite the original somefile.jpg with an 800x600 version of
> somefile.jpg
>
> This gets tricky, because what if the original is taller than it is
> wide?  The above command will distort the image.
>

No it won't.  See the table at
http://www.imagemagick.org/script/command-line-processing.php#geometry:

widthxheightMaximum values of height and width given, aspect ratio 
preserved.

You have to suffix the geometry with a "!" if you want to actually
ignore aspect ratio.

> You can also:
>
> mogrify -resize 30% somefile.jpg
>
> This gives you the correct aspect ratio every time, but what if the
> original image was already small?
>
> Anyway, some food for thought.
>

-- 
regards,
kushal


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CAH8GtdNLnM6pL_f5WvN+ZE_X+UhfFTK8fLKzzhQ=jkv3-fs...@mail.gmail.com



Re: resize pictures received by mailserver

2012-06-13 Thread Tixy
On Wed, 2012-06-13 at 15:08 -0500, Christofer C. Bell wrote:
> The ImageMagick "identify" command could be used on the image to
> gather statistics (such as pixel size) do some math on it, and feed
> that back to mogrify, giving you some consistency in output.
> 
> Example:
> 
> cbell@circe:~$ identify testimage.jpg
> testimage.jpg JPEG 4752x3168 4752x3168+0+0 8-bit DirectClass 5.706MB
> 0.000u 0:00.000
> cbell@circe:~$
> 
> Grab field 3, do some math to determine aspect ratio, compare the
> current resolution against your target, figure out the new size for
> the image, feed that back to mogrify to resize it correctly.
> 
> Want something smaller than 800x600?
> 
> In the above, the image is 4752 x 3168.  We want the image to be
> smaller than 800x600.  We need to decrease the image size by the
> larger of 4752/800 or 3168/600.  These are 5.28 and 5.94 respectively.
>  So we need to decrease the image to 16.8% of its current size
> (1/5.94).
> 
> cbell@circe:~$ mogrify -resize 16.8% testimage.jpg
> cbell@circe:~$ identify testimage.jpg
> testimage.jpg JPEG 798x532 798x532+0+0 8-bit DirectClass 239KB 0.000u 0:00.010
> cbell@circe:~$
> 
> Goal achieved.

It's much simpler to do:

  mogrify -resize '800x600<' testimage.jpg

or to limit it to 800 in any dimension

  mogrify -resize '800x800<' testimage.jpg

(These commands preserve aspect ratio and only resize if image is
greater than the given dimensions.)

-- 
Tixy


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1339654726.3066.6.ca...@computer2.home



Re: resize pictures received by mailserver

2012-06-13 Thread Richard Hector
On 13/06/12 22:45, Randall wrote:

> is it possible to have all messages received by the mailinglists MTA
> scanned for pictures and have these automatically scaled to a default
> size before its being redistributed to the receivers on the mailinglist
> and subsequently the forum.

You'll break any signatures on the email, of course.

That may not matter in your case.

Richard


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4fd98449.1040...@walnut.gen.nz



Re: resize pictures received by mailserver

2012-06-13 Thread Christofer C. Bell
On Thu, Jun 14, 2012 at 1:18 AM, Tixy  wrote:
> On Wed, 2012-06-13 at 15:08 -0500, Christofer C. Bell wrote:
>> The ImageMagick "identify" command could be used on the image to
>> gather statistics (such as pixel size) do some math on it, and feed
>> that back to mogrify, giving you some consistency in output.
>>
>> Example:
>>
>> cbell@circe:~$ identify testimage.jpg
>> testimage.jpg JPEG 4752x3168 4752x3168+0+0 8-bit DirectClass 5.706MB
>> 0.000u 0:00.000
>> cbell@circe:~$
>>
>> Grab field 3, do some math to determine aspect ratio, compare the
>> current resolution against your target, figure out the new size for
>> the image, feed that back to mogrify to resize it correctly.
>>
>> Want something smaller than 800x600?
>>
>> In the above, the image is 4752 x 3168.  We want the image to be
>> smaller than 800x600.  We need to decrease the image size by the
>> larger of 4752/800 or 3168/600.  These are 5.28 and 5.94 respectively.
>>  So we need to decrease the image to 16.8% of its current size
>> (1/5.94).
>>
>> cbell@circe:~$ mogrify -resize 16.8% testimage.jpg
>> cbell@circe:~$ identify testimage.jpg
>> testimage.jpg JPEG 798x532 798x532+0+0 8-bit DirectClass 239KB 0.000u 
>> 0:00.010
>> cbell@circe:~$
>>
>> Goal achieved.
>
> It's much simpler to do:
>
>  mogrify -resize '800x600<' testimage.jpg
>
> or to limit it to 800 in any dimension
>
>  mogrify -resize '800x800<' testimage.jpg
>
> (These commands preserve aspect ratio and only resize if image is
> greater than the given dimensions.)

Well, color me impressed!  I didn't know about that notation.  That
certainly would have saved me a lot of pain with some shell scripts I
wrote awhile back for image management!  I'll keep that in my bag of
tricks and thank you for the tip!


-- 
Chris


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/caoevnyujsmftaqze+suzcvhjnvk48hnvjlngofzg5bxu-xv...@mail.gmail.com



Re: resize pictures received by mailserver

2012-06-14 Thread Rob Owens
On Thu, Jun 14, 2012 at 11:47:52AM +0530, Kushal Kumaran wrote:
> On Wed, Jun 13, 2012 at 11:17 PM, Rob Owens  wrote:
> > On Wed, Jun 13, 2012 at 12:45:13PM +0200, Randall wrote:
> >>
> >> is it possible to have all messages received by the mailinglists MTA
> >> scanned for pictures and have these automatically scaled to a
> >> default size before its being redistributed to the receivers on the
> >> mailinglist and subsequently the forum.
> >>
> > craigslist.org seems to do this when you upload pictures of the item
> > you're selling.  I'm not sure how they do it, but I imagine they use the
> > mogrify command from imagemagick:
> >
> > mogrify -resize 800x600 somefile.jpg
> >
> > This will overwrite the original somefile.jpg with an 800x600 version of
> > somefile.jpg
> >
> > This gets tricky, because what if the original is taller than it is
> > wide?  The above command will distort the image.
> >
> 
> No it won't.  See the table at
> http://www.imagemagick.org/script/command-line-processing.php#geometry:
> 
> widthxheight  Maximum values of height and width given, aspect ratio 
> preserved.
> 
> You have to suffix the geometry with a "!" if you want to actually
> ignore aspect ratio.
> 
Hmm, I just tried it and you are correct.  I swear that it didn't always
work that way (or I'm getting old and imagining things).  Anyway, thanks
for the correction.

-Rob


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120614214157.ga3...@aurora.owens.net



Re: resize pictures received by mailserver

2012-06-14 Thread Arnt Karlsen
On Thu, 14 Jun 2012 01:37:18 -0500, Christofer wrote in message 
:

> > It's much simpler to do:
> >
> >  mogrify -resize '800x600<' testimage.jpg
> >
> > or to limit it to 800 in any dimension
> >
> >  mogrify -resize '800x800<' testimage.jpg
> >
> > (These commands preserve aspect ratio and only resize if image is
> > greater than the given dimensions.)  
> 
> Well, color me impressed!  I didn't know about that notation.  That
> certainly would have saved me a lot of pain with some shell scripts I
> wrote awhile back for image management!  I'll keep that in my bag of
> tricks and thank you for the tip!

..I lost you guys here; is the new trick in the bag the use 
of mogrify, or is it putting the "<" in '800x600<', inside 
the single quotes, typo style like?

-- 
..med vennlig hilsen = with Kind Regards from Arnt Karlsen
...with a number of polar bear hunters in his ancestry...
  Scenarios always come in sets of three: 
  best case, worst case, and just in case.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120615043403.21ec1...@celsius.lan



Re: resize pictures received by mailserver

2012-06-15 Thread Tixy
On Fri, 2012-06-15 at 04:34 +0200, Arnt Karlsen wrote:
> On Thu, 14 Jun 2012 01:37:18 -0500, Christofer wrote in message 
> :
> 
> > > It's much simpler to do:
> > >
> > >  mogrify -resize '800x600<' testimage.jpg
> > >
> > > or to limit it to 800 in any dimension
> > >
> > >  mogrify -resize '800x800<' testimage.jpg
> > >
> > > (These commands preserve aspect ratio and only resize if image is
> > > greater than the given dimensions.)  
> > 
> > Well, color me impressed!  I didn't know about that notation.  That
> > certainly would have saved me a lot of pain with some shell scripts I
> > wrote awhile back for image management!  I'll keep that in my bag of
> > tricks and thank you for the tip!
> 
> ..I lost you guys here; is the new trick in the bag the use 
> of mogrify, or is it putting the "<" in '800x600<', inside 
> the single quotes, typo style like?
> 

It's the < but as that is treated specially by shells, you need to
include the argument in '' or take other precautions.

imagemagic has a wealth of options, it's well worth reading them
whenever you have an image manipulation task. [1] 

-- 
Tixy

[1] http://www.imagemagick.org/script/command-line-options.php



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1339781168.3116.8.ca...@computer2.home



Re: resize pictures received by mailserver

2012-06-16 Thread Arnt Karlsen
On Fri, 15 Jun 2012 18:26:08 +0100, Tixy wrote in message 
<1339781168.3116.8.ca...@computer2.home>:

> On Fri, 2012-06-15 at 04:34 +0200, Arnt Karlsen wrote:
> > On Thu, 14 Jun 2012 01:37:18 -0500, Christofer wrote in message 
> > :
> > 
> > > > It's much simpler to do:
> > > >
> > > >  mogrify -resize '800x600<' testimage.jpg
> > > >
> > > > or to limit it to 800 in any dimension
> > > >
> > > >  mogrify -resize '800x800<' testimage.jpg
> > > >
> > > > (These commands preserve aspect ratio and only resize if image
> > > > is greater than the given dimensions.)  
> > > 
> > > Well, color me impressed!  I didn't know about that notation.
> > > That certainly would have saved me a lot of pain with some shell
> > > scripts I wrote awhile back for image management!  I'll keep that
> > > in my bag of tricks and thank you for the tip!
> > 
> > ..I lost you guys here; is the new trick in the bag the use 
> > of mogrify, or is it putting the "<" in '800x600<', inside 
> > the single quotes, typo style like?
> > 
> 
> It's the < but as that is treated specially by shells, you need to
> include the argument in '' or take other precautions.

..ah, thanks.

> imagemagic has a wealth of options, it's well worth reading them
> whenever you have an image manipulation task. [1] 

..aye, I went the graphicsmagick route but I don't recall why. ;o)

-- 
..med vennlig hilsen = with Kind Regards from Arnt Karlsen
...with a number of polar bear hunters in his ancestry...
  Scenarios always come in sets of three: 
  best case, worst case, and just in case.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120616122213.0670c...@celsius.lan