converting a tiff image

109 views
Skip to first unread message

Mike C

unread,
Feb 23, 2010, 4:41:43 PM2/23/10
to Ruby on Rails: Talk
Does anyone know of a way to convert an uploaded tiff image into a jpg
or png?

Robert Walker

unread,
Feb 23, 2010, 4:59:08 PM2/23/10
to rubyonra...@googlegroups.com
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
--
Posted via http://www.ruby-forum.com/.

Mike C

unread,
Feb 23, 2010, 5:19:33 PM2/23/10
to Ruby on Rails: Talk
Thanks. How can I use paperclip to convert? I tried looking it up in
google but got no results.

Peter De Berdt

unread,
Feb 23, 2010, 6:24:28 PM2/23/10
to rubyonra...@googlegroups.com

On 23 Feb 2010, at 23:19, Mike C wrote:

Thanks. How can I use paperclip to convert? I tried looking it up in
google but got no results.

On Feb 23, 1:59 pm, Robert Walker <li...@ruby-forum.com> wrote:
Mike Chai wrote:
Does anyone know of a way to convert an uploaded tiff image into a jpg
or png?

http://github.com/thoughtbot/papercliphttp://www.imagemagick.org/script/index.php


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


Walter McGinnis

unread,
Feb 23, 2010, 6:31:45 PM2/23/10
to rubyonra...@googlegroups.com
This is actually used with AttachmentFu, but has some example code for
Rmagick resizing:

http://github.com/kete/kete/blob/master/lib/resize_as_jpeg_when_necessary.rb#59

Cheers,
Walter

> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-ta...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

Walter McGinnis

unread,
Feb 23, 2010, 6:32:50 PM2/23/10
to rubyonra...@googlegroups.com
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

Mike C

unread,
Feb 25, 2010, 4:29:30 AM2/25/10
to Ruby on Rails: Talk
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?

On Feb 23, 3:32 pm, Walter McGinnis <walter.mcgin...@gmail.com> wrote:
> 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
>
>
>
> <walter.mcgin...@gmail.com> wrote:
> > This is actually used with AttachmentFu, but has some example code for
> > Rmagick resizing:
>

> >http://github.com/kete/kete/blob/master/lib/resize_as_jpeg_when_neces...


>
> > Cheers,
> > Walter
>
> > On Wed, Feb 24, 2010 at 12:24 PM, Peter De Berdt
> > <peter.de.be...@pandora.be> wrote:
>
> >> On 23 Feb 2010, at 23:19, Mike C wrote:
>
> >> Thanks. How can I use paperclip to convert? I tried looking it up in
> >> google but got no results.
>
> >> On Feb 23, 1:59 pm, Robert Walker <li...@ruby-forum.com> wrote:
>
> >> Mike Chai wrote:
>

> >> Does anyone know of a way to convert an uploadedtiffimage into a jpg
>
> >> or png?
>
> >>http://github.com/thoughtbot/papercliphttp://www.imagemagick.org/scri...
>
> >> Use :convert_options as shown
> >> here: http://www.taknado.com/en/2009/10/01/paperclip-tweaks/(found using

Craig White

unread,
Feb 25, 2010, 9:35:32 AM2/25/10
to rubyonra...@googlegroups.com
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.

danny thyui

unread,
Sep 29, 2013, 2:37:57 AM9/29/13
to rubyonra...@googlegroups.com
you can try some third pdrty pdf converter dll to convert pdf to html ,i
think can be much easier if a converter dll is employed. have a check!
http://www.rasteredge.com/how-to/vb-net-imaging/tiff-converting/

arron w.

unread,
Nov 6, 2013, 3:36:59 AM11/6/13
to rubyonra...@googlegroups.com
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?

Walter Lee Davis

unread,
Nov 6, 2013, 8:47:52 AM11/6/13
to rubyonra...@googlegroups.com

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

Reply all
Reply to author
Forward
0 new messages