Feature #3510

Inserting image thumbnails inside the wiki

Added by Dario Dario over 8 years ago. Updated about 4 years ago.

Status:ClosedStart date:2009-06-18
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Text formatting
Target version:2.1.0
Resolution:Fixed

Description

Hi, actually adding images inside the wiki with the syntax is really easy. But what if I want to insert an image THUMBNAIL, instead? I suggest something like this:

Maybe we might even add support for "intelligent ratio" handling and squared thumbs:

-> this should create a thumbnail 250px wide and automatically calculate height (using the original ratio).
-> this should square/crop
-> maybe rounded corners support? I'm over-requesting...

Obviously Rmagick should be enabled...

Hope this sounds useful, thanks in advance and keep up the great work

Dario

Redmine_-_Overview_-_Redmine_1283114957430.png (119 KB) jon hertzig, 2010-08-29 22:47

Associated revisions

Revision 10013
Added by Jean-Philippe Lang over 5 years ago

Adds a macro for inserting thumbnails in formatted text (#3510).

History

#1 Updated by Dario Dario over 8 years ago

I didn't notice the ! macro was hiding my suggestion ... Here's what I meant to say :)

! imageurl,w=800,h=300 !

Maybe we might even add support for "intelligent ratio" handling and squared thumbs:

! imageurl,w=250 ! -> this should create a thumbnail 250px wide and automatically calculate height (using the original ratio).

! imageurl,w=250,crop ! -> this should square/crop
! imageurl,w=250,round ! -> maybe rounded corners support? I'm over-requesting...

#2 Updated by Davis Tan about 8 years ago

I've have worked with thumbnails in php awhile ago. You can refer to one of my sites:
http://www.worthsave.com/product_thumb.php?img=images/gr.png&w=43&h=80

product_thumb.php will save a cache copy in the same folder of the picture.

We can have this implemented as a project setting for max height / width for thumbnails.

Will also need a wiki macro to handle the thumbnail version of the picture and optionally, click to zoom in to original size. Lightbox or similar js popups can be easily integrated.

Currently I'm using Redmine Wiki in our company's product documentation effort and looking forward to open it as a public site for our customers.

#3 Updated by Davis Tan about 8 years ago

I found a simple ruby script for doing similar:

Resizing images using RMagick

#4 Updated by Just Lest almost 8 years ago

you can test my plugin http://github.com/lest/redmine_thumbnails

it requires installed ImageMagick and mini_magick gem

it adds macro

{{thumb(attachment_name)}}

you can specify width or height of thumbnail

{{thumb(attachment_name, width=300)}}
{{thumb(attachment_name, height=300)}}
{{thumb(attachment_name, width=300, height=300)}}

or set default values on plugin settings page

#5 Updated by Dario Dario almost 8 years ago

Great! I will test this, thanks a lot. Hope your plugin gets implemented into the main trunk ;) does it work with file attached to the issue or even with files relative to other issues, wiki etc?

#6 Updated by Just Lest almost 8 years ago

Dario Dario wrote:

Great! I will test this, thanks a lot. Hope your plugin gets implemented into the main trunk ;) does it work with file attached to the issue or even with files relative to other issues, wiki etc?

at this moment there is no documentation because i create it for my company internal use and only publish on github

soon i'll add some documentation and post link to it here

#7 Updated by Just Lest almost 8 years ago

some documentation to my plugin available on github http://github.com/lest/redmine_thumbnails/blob/master/README.rdoc
also you can post issues on github

#8 Updated by Jason Mitchell over 7 years ago

This seems like a duplicate of #949, which is still not fixed after being open for nearly 2 yrs...

#9 Updated by jon hertzig about 7 years ago

Here's a workaround: "!{width:200px}<image.png>!":<URL for attachment>

#10 Updated by jon hertzig about 7 years ago

Like this:

#11 Updated by jon hertzig about 7 years ago

This only works if you comment (or remove) "self.filter_styles=true" in wiki_formatting\textile\formatter.rb

-- which lets you do lots of other wiki formatting as well, but apparently "can make Redmine vulnerable to XSS-attacks" see issue #949

#12 Updated by Etienne Massip about 6 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Closed as duplicate of #1006.

#13 Updated by Kfir Lavi over 5 years ago

Hi,
I'm running Gentoo with:
dev-ruby/rails-2.3.14
www-apps/redmine-1.3.0

I have installed https://github.com/lest/redmine_thumbnails
but it doesn't work.
It seems that the wiki doesn't recognize {{thumb()}} notation.
I tried also what jon hertzig said about "self.filter_styles=true" in wiki_formatting\textile\formatter.rb above.
Can someone explain how to use this?

Regards,
Kfir

#14 Updated by Jean-Philippe Lang over 5 years ago

  • Category changed from Wiki to Text formatting
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.1.0
  • Resolution changed from Duplicate to Fixed

Different of #1006 actually and implemented in r10013.
A new thumbnail macro lets you insert clickable thumbnails of attached images with the following syntax:

{{thumbnail(image.png)}}
{{thumbnail(image.png, size=200)}}
{{thumbnail(image.png, size=200, title=Cool image)}}

Imagemagick's `convert` binary needs to be installed so that thumbnails can be generated (RMagick gem is not required).

#15 Updated by hari gowtham about 4 years ago

Also available in: Atom PDF