Forum: Ruby on Rails converting a tiff image

Af25c598c54850cd55e07b1d060df9e1?d=identicon&s=25 Mike Chai (mlchai)
on 2010-02-23 22:42
(Received via mailing list)
Does anyone know of a way to convert an uploaded tiff image into a jpg
or png?
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2010-02-23 22:59
Mike Chai wrote:
> Does anyone know of a way to convert an uploaded tiff image into a jpg
> or png?

http://github.com/thoughtbot/paperclip
http://www.imagemagick.org/script/index.php
Af25c598c54850cd55e07b1d060df9e1?d=identicon&s=25 Mike Chai (mlchai)
on 2010-02-23 23:21
(Received via mailing list)
Thanks. How can I use paperclip to convert? I tried looking it up in
google but got no results.
00973881979aa0a660ffbbb2f7a907fb?d=identicon&s=25 Peter De Berdt (Guest)
on 2010-02-24 00:26
(Received via mailing list)
On 23 Feb 2010, at 23:19, Mike C wrote:

>
Use :convert_options as shown here:
http://www.taknado.com/en/2009/10/01/paperclip-tweaks/
  (found using "paperclip rails convert file" on google). Someone else
will be able to give you the imagemagick command parameter to convert
to jpg I hope, don't know it by heart.


Best regards

Peter De Berdt
A39970d780c506b26e9a8b71eda13df2?d=identicon&s=25 Walter McGinnis (Guest)
on 2010-02-24 00:33
(Received via mailing list)
This is actually used with AttachmentFu, but has some example code for
Rmagick resizing:

http://github.com/kete/kete/blob/master/lib/resize...

Cheers,
Walter

On Wed, Feb 24, 2010 at 12:24 PM, Peter De Berdt
A39970d780c506b26e9a8b71eda13df2?d=identicon&s=25 Walter McGinnis (Guest)
on 2010-02-24 00:34
(Received via mailing list)
The #59 meaning the relevant line is mainly the setting of format in
line 59.  There is other stuff in their you may find useful, too.

Cheers,
Walter

On Wed, Feb 24, 2010 at 12:31 PM, Walter McGinnis
Af25c598c54850cd55e07b1d060df9e1?d=identicon&s=25 Mike Chai (mlchai)
on 2010-02-25 10:30
(Received via mailing list)
Thanks for the replies. I'm using paperclip, but while search I still
can't find out how to do this. I want to convert the image to jpg/png
ONLY if it's a tiff image. I saw processors/callbacks in paperclip but
I haven't found any way to make a Processor that can do this for me
since I don't know how to call Imagemagick from ruby code. Would I
need Rmagick for this and how would it play in with paperclip?
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2010-02-25 15:36
(Received via mailing list)
On Thu, 2010-02-25 at 01:29 -0800, Mike C wrote:
> Thanks for the replies. I'm using paperclip, but while search I still
> can't find out how to do this. I want to convert the image to jpg/png
> ONLY if it's a tiff image. I saw processors/callbacks in paperclip but
> I haven't found any way to make a Processor that can do this for me
> since I don't know how to call Imagemagick from ruby code. Would I
> need Rmagick for this and how would it play in with paperclip?
----
I don't worry about it because I simply convert everything to jpg.

Of course you have the complete paperclip code so you can see how it's
doing things and modify it for your purposes.

Craig


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
927d157b8ddf72d3eb115c4e4a6e6263?d=identicon&s=25 arron w. (arron_w)
on 2013-11-06 09:36
I have only tried to convert Tiff files using the free trial package of
another Tiff converter:
http://www.yiigo.com/guides/csharp/how-to-tiff-convert.shtml
I am considering to employ one to help me. Do you have any good
suggestion?
A47e0a6beeb9d048ff054fc1c3a97418?d=identicon&s=25 Walter Davis (walterdavis)
on 2013-11-06 14:49
(Received via mailing list)
On Nov 6, 2013, at 3:36 AM, arron w. wrote:

> I have only tried to convert Tiff files using the free trial package of
> another Tiff converter:
> http://www.yiigo.com/guides/csharp/how-to-tiff-convert.shtml
> I am considering to employ one to help me. Do you have any good
> suggestion?
>

Install imagemagick on your server. It's free, and very powerful.
Converting a TIFF to another image format is as simple as this:

  convert /path/to/image.tiff /path/to/output.jpg

Naturally, you can do almost anything and tweak almost anything, given
the right flags passed to the convert command. If imagemagick can't open
or understand the file, it's highly unlikely that it is an image at all.

Walter
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.