Defect #949

Style not applied to wiki image

Added by Wes Billman over 10 years ago. Updated over 3 years ago.

Status:ClosedStart date:2008-03-28
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Attachments
Target version:-
Resolution:Wont fix Affected version:

Description

Wiki images should resize.

Often I add large screen shots to wiki pages and it would be great to be able to specify a size (either globally or per image) of a thumbnail. So that inline wiki images would not fill the full wiki page.

Forgive me if this is a duplicate, I did a quick search but didn't find anything.

image_resize_classic_redmine_theme.diff Magnifier - patch for auto-resizing and click on image to get full-size (3.49 KB) rm user, 2012-06-26 01:47


Related issues

Related to Redmine - Feature #2416: {background:color} doesn't work in text formatting Closed 2008-12-30
Duplicated by Redmine - Feature #4453: Fully implement Textile Closed 2009-12-20
Duplicated by Redmine - Defect #7395: Attached images don't resize Closed 2011-01-21

History

#1 Updated by Rachel Majchrzak over 10 years ago

+1

#2 Updated by Chris Pitzer over 10 years ago

Agreed. Something like...

!image.png!

...displays a normal image, and...

!size(width,300,image.png)!

...displays an image at 300px width. And by default clicking a resized image should link to the full sized image. (the resize could just be the normal image with width="300" on the html tag, or it could be resized server side... but the syntax remains the same.)

As I put all my design notes up on the wiki, having thumbnail capacity would be really really helpful for me. Waiting for a half dozen images to load all the time sucks.

#3 Updated by dop in over 10 years ago

+1

#4 Updated by Marcello Henrique over 10 years ago

+1

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

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

The syntax is:

!{width:300px}image.png!

I'll add it to the doc.

#6 Updated by Anh Kỳ Huỳnh almost 10 years ago

  • Status changed from Closed to Reopened

My site is using Redmine 080. The parameter {width:...} doesnot work anymore.

#7 Updated by Alexey Lustin almost 10 years ago

Kỳ Anh Huỳnh wrote:

My site is using Redmine 080. The parameter {width:...} doesnot work anymore.

+1

in my testing portal work on Redmine trunk version width does't work too

i have tried to set the width of atached image and to image with url - same result - does't render

#8 Updated by Martin Eckhardt almost 10 years ago

+1

Same at my company. A user tried to resize an image without success. We tried both url + attachment. Its rather annoying to resize it by hand.

#9 Updated by Jérémie Delaitre almost 10 years ago

I'm using redmine trunk and it does not work too...

#10 Updated by Nicklas Holm almost 10 years ago

Not for me either...

#11 Updated by Franc Marx over 9 years ago

after update to Redmine 0.8.0 picture resize doesn't mork anymore

"!{width:300px}picture.jpg!"

#12 Updated by Andy Wiltshire over 9 years ago

Franc Marx wrote:

after update to Redmine 0.8.0 picture resize doesn't mork anymore

[...]

Agreed. We really need to be able to resize images. How hard is it to integrate some sort of autothumbnail or resizer? Formatting of posts/messages is lacking a bit for what we want to do.

#13 Updated by Cyber Sprocket over 9 years ago

+1

!{width:300px}image.png! does not work on latest production release Redmine 0.8.4.stable.2769 (MySQL)

#14 Updated by Andrew Chaika over 9 years ago

Franc Marx wrote:

after update to Redmine 0.8.0 picture resize doesn't mork anymore

Just comment (or remove) in wiki_formatting\textile\formatter.rb line:

self.filter_styles=true

#15 Updated by Mischa The Evil over 9 years ago

Andrew Chaika wrote:

Franc Marx wrote:

after update to Redmine 0.8.0 picture resize doesn't mork anymore

Just comment (or remove) in wiki_formatting\textile\formatter.rb line:
[...]

Be aware that this "hack" can make Redmine vulnerable to XSS-attacks. See #2416 for the whole story.

HTH...

#16 Updated by Michael Koch about 9 years ago

+1 on adding the ability to resize images. we have had a lot of people complain about this. will it be fixed? ever? or is the security issue to relevant?

#17 Updated by Mischa The Evil about 9 years ago

  • Resolution deleted (Fixed)

#18 Updated by Antti Kaijanmäki about 9 years ago

+1, anyone working on this?

#19 Updated by Jean-Philippe Lang almost 9 years ago

  • Subject changed from Wiki Image Resizing to Resizing attached image
  • Category changed from Wiki to Attachments

#20 Updated by Tiago Alves almost 9 years ago

+1

While this isn't solved I added this CSS snippet to our theme's application.css stylesheet:

#content .wiki img {
   max-width: 98%;
}

This resizes images that are larger than the wiki page itself.

#21 Updated by Enterux Solutions almost 9 years ago

+1
Any updates to this issue. I've redmine 0.9.2 Setup. Does every thing i want. Needs this feature to make wiki pages look good. Should be like we get to see the full size image when clicked on the resized image.

#22 Updated by Kamil . almost 9 years ago

Maybe image should automatically fit to wiki page size?

#23 Updated by Jason Mitchell over 8 years ago

+1
Extremely annoying. Any hope of correcting this or is the intent to use the plugin described in #3510?

#24 Updated by Rocco Stanzione over 8 years ago

The behavior appears (from code and comments) to be a security feature intended to help protect public sites. You can change it back to the old behavior by commenting out this line:
self.filter_styles=true

in the initialize method of Redmine::WikiFormatting::Textile::Formatter in lib/redmine/wiki_formatting/textile/formatter.rb

#25 Updated by jon hertzig over 8 years ago

If you're willing to change the "self.filter_styles=true" line in wiki_formatting\textile\formatter.rb (and allow the XSS vulnerability), you can dummy a thumbnail by " ":<URL for attachment>

#26 Updated by jon hertzig over 8 years ago

jon hertzig wrote:

If you're willing to change the "self.filter_styles=true" line in wiki_formatting\textile\formatter.rb (and allow the XSS vulnerability), you can dummy a thumbnail by " ":<URL for attachment>

(should be:)

" !{width:200px}<image.png>!":<URL for attachment>

#27 Updated by James Rowe over 8 years ago

+1

is there a suggested donation to commence work on this feature?

This is a huge annoyance for us. We don't want to lose resolution on screen captures, but want to include them in the wiki.

Request tracker (other system that we plan on moving away from) will take the attached image and fit it nicely within the comment; a la maxwidth:98% kind of css.

#28 Updated by Zbynek Drlik about 8 years ago

+1

#29 Updated by egor sh almost 8 years ago

+1

#30 Updated by Ian DeFazio almost 8 years ago

+1

#31 Updated by Paul Heyer almost 8 years ago

+1

#33 Updated by Terence Mill almost 8 years ago

+1

#34 Updated by Lu Pa almost 8 years ago

+1

#35 Updated by Frederic Servant almost 8 years ago

+1

#36 Updated by thihy thihy almost 8 years ago

+1

#37 Updated by Josh Davidson almost 8 years ago

Can't believe this obvious issue is three years old...+1

#38 Updated by Patrice Bonhomme over 7 years ago

Thanks, it works very well.

Patrice

Tiago Alves wrote:

+1

While this isn't solved I added this CSS snippet to our theme's application.css stylesheet:
[...]

This resizes images that are larger than the wiki page itself.

#39 Updated by Dominic Clifton over 7 years ago

+1

Can a Redmine maintainer please schedule this for inclusion in an upcoming or future release so that we all know when to look out for this much-requested feature.

We're currently using Redmine 1.1.2.stable.5026

#40 Updated by Andrew Levshoff over 7 years ago

+1

This is a "must have" feature for wiki syntax.

#41 Updated by Terence Mill over 7 years ago

+1

#42 Updated by Roman Gaufman over 7 years ago

+1

#43 Updated by Cornell Wright over 7 years ago

+1

Is this ever going to be fixed??

#44 Updated by Andy Dufilie over 7 years ago

+1

#45 Updated by Joe Kandaba over 7 years ago

+1 This should be one line of code right ?

#46 Updated by Christian Köwing over 7 years ago

+1

Incredible that such a simple function is not yet implemented.

#47 Updated by Not Needed over 7 years ago

+1, common guys, such a great tool missing a basic feature like this is just wrong.

#48 Updated by Eric Voisard over 7 years ago

+1

#49 Updated by Fabio Sousa over 7 years ago

worrying! With all due respect, but makes us think about the future of the project

#50 Updated by Pavel Konstantinov over 7 years ago

+1. It should be easy.

#51 Updated by rafael mello over 7 years ago

+1

#52 Updated by Cassiano Monteiro over 7 years ago

+1!
I´m impressed it´s not even on the roadmap...

#53 Updated by Oli Kessler over 7 years ago

+1
The CSS fix is perfect, in the meantime..

#54 Updated by Axel Pospischil about 7 years ago

Oli Kessler wrote:

+1
The CSS fix is perfect, in the meantime..

dito

Hi there, any news about this?
Really like to impress my managers using this tool, but presenting my class diagrams this way ... ;(
Took me over an hour to find out, that it is not my fault ;)

#55 Updated by Etienne Massip about 7 years ago

  • Target version set to Candidate for next minor release

#56 Updated by Etienne Massip about 7 years ago

  • Tracker changed from Feature to Defect

#57 Updated by Etienne Massip about 7 years ago

  • Subject changed from Resizing attached image to Style not applied to wiki image

#58 Updated by Etienne Massip about 7 years ago

  • Status changed from Reopened to Closed
  • Resolution set to Wont fix

Rocco Stanzione wrote:

The behavior appears (from code and comments) to be a security feature intended to help protect public sites.

Indeed, it appears with r2192 which fixed security issue #2377 together with r2170, concerning possibility to inject JS in page code.

I close this one sine it's not a defect in favor of #1006.

#59 Updated by Etienne Massip about 7 years ago

  • Target version deleted (Candidate for next minor release)

#60 Updated by Etienne Massip almost 7 years ago

BTW, width and height styles are allowed again, see #2416.

#61 Updated by Gary Ritchie almost 7 years ago

Etienne Massip wrote:

BTW, width and height styles are allowed again, see #2416.

Not working for images. Appears to be only for text formatting in r8860.

#62 Updated by rm user over 6 years ago

lol, 4 years and closed without a fix!!

what a shame...

I've used http://www.redmine.org/plugins/redmine_lightbox very nice plugin for attachments on the issues, but it doesn't work for images posted in the redmine..

Any idea how to make a plugin which will parse ALL images pasted into redmine and make them work as the lightbox plugin? (i.e. images posted in one comment to work like lightbox on attachments).

simple testcase:

as you can see it kills the page completely! really need a solution urgently..

#63 Updated by rm user over 6 years ago

  • Status changed from Closed to Reopened

#64 Updated by Jean-Philippe Lang over 6 years ago

  • Status changed from Reopened to Closed

You can now use inline styles:

!{width:400px}http://i.imgur.com/Zb9j0.jpg!

Displays:

#65 Updated by rm user over 6 years ago

  • Status changed from Closed to Reopened

Sorry, but it's really not comfort at all :( How can I get full-size picture? I need to add additional link etc.. Whilst I just want to add an image and click on it to get it full-size.

I'd strongly suggest auto-resizing images automatically via JavaScript.

So when you click on the image you get it in the full-size in a window while other elements on the pages are hidden. After clicking again you get back.

I have very low skill in JS and I don't know what actually redmine uses in terms of JS, but I just did some JS hacking in my theme to get it working exactly like that!

I will share my work bit later when cleanup it a bit. Really need this to be integrated into the redmine.

Also displaying attachments as thumbnails with lightbox would be a very good feature and would bring redmine to the next level of SCM.

#66 Updated by rm user over 6 years ago

So, here is the patch for classic Redmine 1.3 theme (I'm not sure if it was changed in recent editions):

http://pastebin.com/YnneMifB

For default redmine theme the algorythm of patching is the same

JS code goes into javascripts/theme.js and CSS code into stylesheets/application.css.

It's a bit hacky solution because it replaces all <img> tags without onclick action defined and resizes all wiki images automatically to 500px, on click you get a full-size image.

I'm not an expert of JavaScript or Ruby so can't really say how to apply this onclick event to only wiki/issue images.

Also attached it in case pastebin fails.

#67 Updated by Jean-Philippe Lang over 6 years ago

  • Status changed from Reopened to Closed

Please don't reopen this issue that was about being able to apply inline styles.
Have a look at #1006 instead.

#68 Updated by rm user over 6 years ago

Jean-Philippe Lang wrote:

Please don't reopen this issue that was about being able to apply inline styles.
Have a look at #1006 instead.

I understand what you're saying, but it's a bit different issue, because it's about attachment whilst this issue is about images posted into any message body (i.e. in forums/wiki/issues).

Anyways I see nobody seems to care about this much, so I just resolved this with dirty workaround.

#69 Updated by Chris Wilson over 6 years ago

I don't want thumbnails, which is what #1006 is about.

I want sensibly sized images, with borders, in my pages. I want to be able to apply arbitrary styles to images, as supported by Textile.

This is on a private site, so I don't care about XSS. I would at least like an option to disable the filtering, so that we have the full power of Textile.

Please, please reopen this issue.

#70 Updated by Alex Dergachev over 3 years ago

For anyone who stumbles across this old issue, if you want "sensibly sized images, with borders", with clicking to see full-size, check out this mini plugin we've been using for years. https://github.com/evolvingweb/redmine_thumbnail_embed

#71 Updated by rm user over 3 years ago

Alex Dergachev wrote:

For anyone who stumbles across this old issue, if you want "sensibly sized images, with borders", with clicking to see full-size, check out this mini plugin we've been using for years. https://github.com/evolvingweb/redmine_thumbnail_embed

as far as i understood it's just a plugin to make thumbnails of images via special tag

{{thumbnail}}
or so

so it means i need to edit all previously linked images to display them properly on pages.

instead just apply my solution (patch redmine's theme) so on any page images will be automatically resized and give you full size image if you click on the image.

Also available in: Atom PDF