[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

how about upload an image?

James

4/19/2006 12:40:00 AM

if any one knows how to upload an image to a server and save that image
as is and also save a smaller thumbnail of that image to the same
directory, please let me know the code.
think u!

23 Answers

Tim Hunter

4/19/2006 1:09:00 AM

0

James wrote:
> if any one knows how to upload an image to a server and save that image
> as is and also save a smaller thumbnail of that image to the same
> directory, please let me know the code.
> think u!
>
If you're using Rails, check out FileColumn:
http://www.kanthak.net/opensource/fi...

James Herdman

4/19/2006 3:38:00 PM

0

Ooh! Thanks for the link.

Something else you might want to check out, James, is RMagick
(http://rmagick.ruby...). This is a Ruby interface (not in the
Java sense) to allow image manipulation via ImageMagick, or
GraphicsMagick. It's a bit tedious to install, but it appears to be
quite powerful.

Best of luck,

James H.

Dave Burt

4/19/2006 4:38:00 PM

0

James H. wrote:
> Ooh! Thanks for the link.
>
> Something else you might want to check out, James, is RMagick
> (http://rmagick.ruby...). This is a Ruby interface (not in the
> Java sense) to allow image manipulation via ImageMagick, or
> GraphicsMagick. It's a bit tedious to install, but it appears to be
> quite powerful.

I'd like to say, I installed RMagick, and expected to have to do a bunch
of work to get the image info and some relatively involved manipulations
I wanted, but it was dead simple. RMagick kicks butt.

Here's a snippet from a Rails app of mine. (This is simple
thumbnail-making, not the stuff I was talking about above.) image_data
is the contents of an uploaded image, as a string. THUMB_GEOMETRY is
"120x120>", meaning shrink to fit inside a 120x120 box unless it already
does.

image = Magick::Image.from_blob(image_data).first
image.change_geometry(THUMB_GEOMETRY) do |cols, rows, image|
image.resize! cols, rows
end
image.write File.join(RAILS_ROOT, 'public', thumbnail)

Cheers,
Dave

Malcolm

4/10/2011 9:56:00 AM

0


In article <3hu2q6pig2d9rm0lfemvluf2losh0v7iq1@4ax.com>, Fred J. McCall
<fjmccall@gmail.com> writes
>
>Hey, I don't mind you making yourself looking like a whiny, ignorant
>twat if you don't mind making Akins feel all warm and fuzzy and like
>he's justified in his beliefs.
>
And exactly what do you think you are doing with your puerile level of
response to him?

--
Malcolm

Malcolm

4/10/2011 12:40:00 PM

0


In article
<d88928fe-f5b9-46e4-831e-af96103111c2@k30g2000yqb.googlegroups.com>,
Akins of that Ilk <the_akins_of_akins@yahoo.com> writes
>On Apr 10, 4:30?am, Malcolm <Malc...@indaal.demon.co.uk> wrote:
>> In article
>> <b26a2e49-c6e9-4498-9812-fd8e8925f...@t13g2000vbo.googlegroups.com>,
>> Akins of that Ilk <the_akins_of_ak...@yahoo.com> writes
>>
>> >In determining what is normal, majority rules. Anything that deviates
>> >from the norm is, deviant.
>>
>> Balderdash.
>>
>> Even in your country, the majority don't have your extreme right-wing
>> beliefs about the "White race" and Jews, which thus makes you a deviant.
>
>The majority of the population are clueless sheep.

A feeble answer which, typical of you, attempts to move the goalposts.

You stated that "majority rules" and, when offered an example that you
couldn't agree with, all you could think of was to condemn the majority
with which you don't agree. You've merely confirmed yourself as a
"deviant" by your own definition.

--
Malcolm

Akins of that Ilk

4/10/2011 1:10:00 PM

0

On Apr 10, 7:40 am, Malcolm <Malc...@indaal.demon.co.uk> wrote:
> In article
> <d88928fe-f5b9-46e4-831e-af9610311...@k30g2000yqb.googlegroups.com>,
> Akins of that Ilk <the_akins_of_ak...@yahoo.com> writes
>
> >On Apr 10, 4:30 am, Malcolm <Malc...@indaal.demon.co.uk> wrote:
> >> In article
> >> <b26a2e49-c6e9-4498-9812-fd8e8925f...@t13g2000vbo.googlegroups.com>,
> >> Akins of that Ilk <the_akins_of_ak...@yahoo.com> writes
>
> >> >In determining what is normal, majority rules. Anything that deviates
> >> >from the norm is, deviant.
>
> >> Balderdash.
>
> >> Even in your country, the majority don't have your extreme right-wing
> >> beliefs about the "White race" and Jews, which thus makes you a deviant.
>
> >The majority of the population are clueless sheep.
>
> A feeble answer which, typical of you, attempts to move the goalposts.
>
> You stated that "majority rules" and, when offered an example that you
> couldn't agree with, all you could think of was to condemn the majority
> with which you don't agree. You've merely confirmed yourself as a
> "deviant" by your own definition.
>
> --
> Malcolm

Sure I deviate from the majority in not being a clueless, brainwashed
tool; but the majority are still straight, and so am I.

Malcolm

4/10/2011 1:43:00 PM

0


In article
<9aa18293-425a-4998-974c-5da7dbf17c11@y26g2000yqd.googlegroups.com>,
Akins of that Ilk <the_akins_of_akins@yahoo.com> writes
>On Apr 10, 7:40?am, Malcolm <Malc...@indaal.demon.co.uk> wrote:
>> In article
>> <d88928fe-f5b9-46e4-831e-af9610311...@k30g2000yqb.googlegroups.com>,
>> Akins of that Ilk <the_akins_of_ak...@yahoo.com> writes
>>
>> >On Apr 10, 4:30 am, Malcolm <Malc...@indaal.demon.co.uk> wrote:
>> >> In article
>> >> <b26a2e49-c6e9-4498-9812-fd8e8925f...@t13g2000vbo.googlegroups.com>,
>> >> Akins of that Ilk <the_akins_of_ak...@yahoo.com> writes
>>
>> >> >In determining what is normal, majority rules. Anything that deviates
>> >> >from the norm is, deviant.
>>
>> >> Balderdash.
>>
>> >> Even in your country, the majority don't have your extreme right-wing
>> >> beliefs about the "White race" and Jews, which thus makes you a deviant.
>>
>> >The majority of the population are clueless sheep.
>>
>> A feeble answer which, typical of you, attempts to move the goalposts.
>>
>> You stated that "majority rules" and, when offered an example that you
>> couldn't agree with, all you could think of was to condemn the majority
>> with which you don't agree. You've merely confirmed yourself as a
>> "deviant" by your own definition.
>
>Sure I deviate from the majority in not being a clueless, brainwashed
>tool;

No, you're a clueless racist and white supremacist which makes you a
deviant in anyone's book..

> but the majority are still straight, and so am I.

So are all Druids "straight"? And were they all when they were
"priests", terrorising the masses?

--
Malcolm

Malcolm

4/10/2011 1:47:00 PM

0


In article
<1641d374-534f-4609-8af4-3186ec6832c2@27g2000yqv.googlegroups.com>,
Akins of that Ilk <the_akins_of_akins@yahoo.com> writes
>On Apr 10, 4:30?am, Malcolm <Malc...@indaal.demon.co.uk> wrote:
>> In article
>>
>> Even in your country, the majority don't have your extreme right-wing
>> beliefs about the "White race" and Jews, which thus makes you a deviant.
>
>http://www.stormfront.org...

ROFL!!!

"We are a community of White Nationalists."

Yes, well, says it all really. You didn't have to tell us that you are a
supporter of an American white supremacist organisation - it would have
been more surprising, given the nastiness you spew, if you hadn't been.

--
Malcolm

Akins of that Ilk

4/10/2011 2:26:00 PM

0

On Apr 10, 8:43 am, Malcolm <Malc...@indaal.demon.co.uk> wrote:
> In article
> <9aa18293-425a-4998-974c-5da7dbf17...@y26g2000yqd.googlegroups.com>,
> Akins of that Ilk <the_akins_of_ak...@yahoo.com> writes
>
>
>
>
>
> >On Apr 10, 7:40 am, Malcolm <Malc...@indaal.demon.co.uk> wrote:
> >> In article
> >> <d88928fe-f5b9-46e4-831e-af9610311...@k30g2000yqb.googlegroups.com>,
> >> Akins of that Ilk <the_akins_of_ak...@yahoo.com> writes
>
> >> >On Apr 10, 4:30 am, Malcolm <Malc...@indaal.demon.co.uk> wrote:
> >> >> In article
> >> >> <b26a2e49-c6e9-4498-9812-fd8e8925f...@t13g2000vbo.googlegroups.com>,
> >> >> Akins of that Ilk <the_akins_of_ak...@yahoo.com> writes
>
> >> >> >In determining what is normal, majority rules. Anything that deviates
> >> >> >from the norm is, deviant.
>
> >> >> Balderdash.
>
> >> >> Even in your country, the majority don't have your extreme right-wing
> >> >> beliefs about the "White race" and Jews, which thus makes you a deviant.
>
> >> >The majority of the population are clueless sheep.
>
> >> A feeble answer which, typical of you, attempts to move the goalposts.
>
> >> You stated that "majority rules" and, when offered an example that you
> >> couldn't agree with, all you could think of was to condemn the majority
> >> with which you don't agree. You've merely confirmed yourself as a
> >> "deviant" by your own definition.
>
> >Sure I deviate from the majority in not being a clueless, brainwashed
> >tool;
>
> No, you're a clueless racist and white supremacist which makes you a
> deviant in anyone's book..
>
> > but the majority are still straight, and so am I.
>
> So are all Druids "straight"? And were they all when they were
> "priests", terrorising the masses?

"Druids make their pronouncements by means of riddles and dark
sayings, teaching that the gods must be worshipped, and no evil done,
and manly behavior maintained." - Diogenes Laertius, Lives and
Opinions of Eminent Philosophers, Introduction, 5


Malcolm

4/10/2011 3:18:00 PM

0


In article
<90cdcff5-4a7f-4d19-b15b-d5a8bda67aac@r6g2000vbz.googlegroups.com>,
Akins of that Ilk <the_akins_of_akins@yahoo.com> writes
>On Apr 10, 8:43?am, Malcolm <Malc...@indaal.demon.co.uk> wrote:
>> In article
>> <9aa18293-425a-4998-974c-5da7dbf17...@y26g2000yqd.googlegroups.com>,
>> Akins of that Ilk <the_akins_of_ak...@yahoo.com> writes
>> >On Apr 10, 7:40 am, Malcolm <Malc...@indaal.demon.co.uk> wrote:
>> >> In article
>> >> <d88928fe-f5b9-46e4-831e-af9610311...@k30g2000yqb.googlegroups.com>,
>> >> Akins of that Ilk <the_akins_of_ak...@yahoo.com> writes
>>
>> >> >On Apr 10, 4:30 am, Malcolm <Malc...@indaal.demon.co.uk> wrote:
>> >> >> In article
>> >> >> <b26a2e49-c6e9-4498-9812-fd8e8925f...@t13g2000vbo.googlegroups.com>,
>> >> >> Akins of that Ilk <the_akins_of_ak...@yahoo.com> writes
>>
>> >> >> >In determining what is normal, majority rules. Anything that deviates
>> >> >> >from the norm is, deviant.
>>
>> >> >> Balderdash.
>>
>> >> >> Even in your country, the majority don't have your extreme right-wing
>> >> >> beliefs about the "White race" and Jews, which thus makes you a
>> >> >>deviant.
>>
>> >> >The majority of the population are clueless sheep.
>>
>> >> A feeble answer which, typical of you, attempts to move the goalposts.
>>
>> >> You stated that "majority rules" and, when offered an example that you
>> >> couldn't agree with, all you could think of was to condemn the majority
>> >> with which you don't agree. You've merely confirmed yourself as a
>> >> "deviant" by your own definition.
>>
>> >Sure I deviate from the majority in not being a clueless, brainwashed
>> >tool;
>>
>> No, you're a clueless racist and white supremacist which makes you a
>> deviant in anyone's book..
>>
>> > but the majority are still straight, and so am I.
>>
>> So are all Druids "straight"? And were they all when they were
>> "priests", terrorising the masses?
>
>"Druids make their pronouncements by means of riddles and dark
>sayings, teaching that the gods must be worshipped, and no evil done,
>and manly behavior maintained." - Diogenes Laertius, Lives and
>Opinions of Eminent Philosophers, Introduction, 5
>
"Manly behaviour" written by a Greek is evidence that Druids were
straight???

--
Malcolm