Forum: Ruby on Rails Image manipulation/resizing server-side?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
59ea1b450935b9d70abfec4186b7a4d5?d=identicon&s=25 Jeff Coleman (progressions)
on 2006-03-27 09:32
I'd like to implement a system in a Rails app where I allow the user to
upload an image file, and then the app takes that image and manipulates
it, saving a thumbnail, small, and original size version of the file to
the server.

How would I go about doing that?

Thanks,
Jeff
A4a90580e0113ab143ab29bace65d24c?d=identicon&s=25 poomplex (Guest)
on 2006-03-27 09:38
Jeff Coleman wrote:
>
> I'd like to implement a system in a Rails app where I allow the user to
> upload an image file, and then the app takes that image and manipulates
> it, saving a thumbnail, small, and original size version of the file to
> the server.
>
> How would I go about doing that?

ruby bindings to libimagemagick, http://rmagick.rubyforge.org/
9c0eebc506c56c64dc616cdf123fa671?d=identicon&s=25 Chris Chris (aboulafia)
on 2006-03-27 10:49
You should have a look to mini_magick which is less resource demanding
than RMagick.

Then it's just a simple as :

thumbnail = MiniMagick::Image.from_file(src_filename)
thumbnail.resize "500x400"
thumbnail.write(dst_filename)

You need to have imagemagick installed (native application)
59ea1b450935b9d70abfec4186b7a4d5?d=identicon&s=25 Jeff Coleman (progressions)
on 2006-03-27 18:00
Christophe Gimenez wrote:
> You should have a look to mini_magick which is less resource demanding
> than RMagick.
>
> Then it's just a simple as :
>
> thumbnail = MiniMagick::Image.from_file(src_filename)
> thumbnail.resize "500x400"
> thumbnail.write(dst_filename)
>
> You need to have imagemagick installed (native application)

Nice!  Thanks for the info.

Jeff
59ea1b450935b9d70abfec4186b7a4d5?d=identicon&s=25 Jeff Coleman (progressions)
on 2006-03-28 17:05
I'm having trouble using gem to install either RubyMagick or
Mini-Magick.

This is what happens when I try to install RMagick on my Windows XP
computer:

C:\rails>gem install rmagick --include-dependencies
Attempting local installation of 'rmagick'
Building native extensions.  This could take a while...
configure:1: Can't exec \bin\sh (fatal)
ERROR:  Error installing gem rmagick[.gem]: ERROR: Failed t
tension.
Gem files will remain installed in c:/ruby/lib/ruby/gems/1.
 for inspection.
  ruby configure install rmagick --include-dependencies\n

What am I doing wrong?

Thanks,

Jeff
59ea1b450935b9d70abfec4186b7a4d5?d=identicon&s=25 Jeff Coleman (progressions)
on 2006-03-28 17:05
That full error message should be "Failed to build native extension".

Jeff
D2a5b7975f49e051c1de10f98ea81f63?d=identicon&s=25 Chang Sau Sheong (Guest)
on 2006-03-28 17:44
(Received via mailing list)
You need to install the gem locally. Download it first from the site and
do a local installation of the gem.

Jeff Coleman wrote:
> ERROR:  Error installing gem rmagick[.gem]: ERROR: Failed t
>
>


--
Sau Sheong

http://www.saush.com
http://read.saush.com
http://jaccal.sourceforge.net
59ea1b450935b9d70abfec4186b7a4d5?d=identicon&s=25 Jeff Coleman (progressions)
on 2006-03-28 19:27
I'm afraid I get the same message when I try to install it locally:

C:\rails>gem install -l rmagick-1.10.1
Attempting local installation of 'rmagick-1.10.1'
Building native extensions.  This could take a while...
configure:1: Can't exec \bin\sh (fatal)
ERROR:  Error installing gem rmagick-1.10.1[.gem]: ERROR: Failed to
build gem na
tive extension.
Gem files will remain installed in
c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.10.1
 for inspection.
  ruby configure install -l rmagick-1.10.1\n

Results logged to
c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.10.1/gem_make.out


Again I'm sure there must be something very obvious I'm missing, but I'm
not sure what it could be...


Jeff



Chang Sau Sheong wrote:
> You need to install the gem locally. Download it first from the site and
> do a local installation of the gem.
>
> Jeff Coleman wrote:
>> ERROR:  Error installing gem rmagick[.gem]: ERROR: Failed t
>>
>>
>
>
> --
> Sau Sheong
>
> http://www.saush.com
> http://read.saush.com
> http://jaccal.sourceforge.net
E24b2a1d71b7365186a934a09ee6f7c3?d=identicon&s=25 Carl-Johan Kihlbom (Guest)
on 2006-03-28 20:57
(Received via mailing list)
Have you installed ImageMagick?
59ea1b450935b9d70abfec4186b7a4d5?d=identicon&s=25 Jeff Coleman (progressions)
on 2006-03-28 21:07
Carl-Johan Kihlbom wrote:
> Have you installed ImageMagick?

I have installed the ImageMagick DLL installer for Windows found here:
http://www.imagemagick.org/download/binaries/Image...

Jeff
59ea1b450935b9d70abfec4186b7a4d5?d=identicon&s=25 Jeff Coleman (progressions)
on 2006-03-29 06:32
This is just another note to see if anyone has any idea why the RMagick
gem won't install, either locally or remotely.   Anyone?

Jeff Coleman wrote:
>
> I'm afraid I get the same message when I try to install it locally:
>
> C:\rails>gem install -l rmagick-1.10.1
> Attempting local installation of 'rmagick-1.10.1'
> Building native extensions.  This could take a while...
> configure:1: Can't exec \bin\sh (fatal)
> ERROR:  Error installing gem rmagick-1.10.1[.gem]: ERROR: Failed to
> build gem na
> tive extension.
> Gem files will remain installed in
> c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.10.1
>  for inspection.
>   ruby configure install -l rmagick-1.10.1\n
>
> Results logged to
> c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.10.1/gem_make.out

Thanks,

Jeff
E28c35323f624b8b9ed8712e25105454?d=identicon&s=25 Ray Baxter (Guest)
on 2006-03-29 06:48
(Received via mailing list)
Jeff Coleman wrote:
>> ERROR:  Error installing gem rmagick-1.10.1[.gem]: ERROR: Failed to
>> build gem na
>> tive extension.
>> Gem files will remain installed in
>> c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.10.1
>>  for inspection.
>>   ruby configure install -l rmagick-1.10.1\n
>>
>> Results logged to
>> c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.10.1/gem_make.out

You are trying to execute a shell script in a DOS shell.

\bin\sh is the path to a Unix command interpreter, and you more than
likely don't have it and if you do, it is not in \bin or c:\bin

Drilling down, the program that is trying to execute itself with sh is
the program configure, which is a gnu utility to configure a program to
be built in a particular environment.

Long story short, you are either trying to the wrong package (you
downloaded the Unix or maybe Cygwin version of rmagick), or you need to
be building rmagick in Cygwin.

I don't have any first hand knowledge of using gem in Windows, but that
should point you in the right general direction.

--

Ray
Facfb65ddbf0fe0cc81545c8ace1a3cb?d=identicon&s=25 Joseph Graham (Guest)
on 2006-03-29 07:03
(Received via mailing list)
Hello,
I was wondering if anyone could point me to a plugin or framework on how
to
expose SOAP services via rails controllers.  I am particularly
interested in
being able to post a SOAP document as an attachment and handle it in the
controller.  Thanks for your help.
59ea1b450935b9d70abfec4186b7a4d5?d=identicon&s=25 Jeff Coleman (progressions)
on 2006-03-29 07:10
Thanks, Ray, you were exactly right.  I did a bit more digging and found
the appropriate Win32 installers and instructions.  :)

Jeff
D2a5b7975f49e051c1de10f98ea81f63?d=identicon&s=25 Chang Sau Sheong (Guest)
on 2006-03-29 08:17
(Received via mailing list)
This topic is locked and can not be replied to.