When inserting images into a DokuWiki page you have four size options S(w=100), M(w=200), and L(w=300). I find these to be rather small, and in my implementation I would rather have these sizes something like 200, 400, and 600 px wide. Could this be made configurable?
I agree. I'm forced to tell my users not to use the size buttons because the predefined sizes never fit the width of the templates I use.
And, yes, I also agree that a 300px image is not really "large" nowadays.
While the preset image widths are a separate issue - you _can_ set any (reasonable) value if you are not adverse to editing DokuWiki markup.
e.g. use Media Manager to choose an image and pick a size value, then change the size to suit. i.e. change _{{:chrysanthemum.jpg?400|}}_ to _{{:chrysanthemum.jpg?900|}}_ , which will work fine (provided the image size is smaller than the maximum div width of the main content area).
I am aware that the markup can be edited, and I don't mind doing it myself, but telling users to manually set image widths isn't much of a solution.
Here is what I would like to see:
The second item isn't a big deal to me as long as I have the first, but I do think it makes a lot of sense. I can work on this myself, but I'd love to get some input from a DW contributor first.
By clicking a size button in the dialog you let store javascript a value in the range of 1 to 4. (default 2).
Where 4 means using the original size. 1 to 3 are directly converted to the size values by adding two zeros (100, 200, or 300) when clicking the 'Insert' button in the dialog.
See: https://github.com/splitbrain/dokuwiki/blob/master/lib/scripts/media.js#L252
So for different sizes, this line opts += dw_mediamanager.size + '00'; has to be updated to a different conversion of 1, 2 and 3 to three new size values.
For me bigger default sizes make sense.
So I would suggest that you create a pull request with other values.
Who know what has determined current relative small default sizes? Easiness of implementation?
It was written and rewritten by @dom-mel and @adrianheine, do you have some other light on this?
That should be easy enough to change if there is a good way to get the PHP config data in JS. Is that stored in a global JS variable or anything like that? Should I make the file a PHP file and get the data by inserting a few php echo lines?
Improving the current defaults is better then adding another config option.
That reduces also the complexity of getting the config values from php to js. (btw this is possible via JSINFO variable)
I would disagree, but I can work with that. What I've done internally is take size (1-3) * 200. This gives you values of 200, 400, and 600. I'll submit a PR in a minute.
A small demonstration of the effect of different sizes. Applied to some screenshots and some photos, portrait/landscape: https://www.dokuwiki.org/playground:imagesizes
I just stumbled across this issue here today. A little while ago I was facing the same problem, so I made a small plugin that allows the thumbnail sizes to be configured. To be honest though, I think this functionality should be included in DokuWiki core.
I updated my plugin today to reflect the latest core changes and it is now available on GitHub:
https://github.com/mightymt/dokuwiki-plugin-customimagesizes
@mightymt Thank you !
@Klap-in @splitbrain Do you think the functionality of my customimagesizes plugin should eventually be merged into DokuWiki core? Or should this remain a plugin?
Core please !
I think with the new more sensible defaults it's good enough as is.
Most helpful comment
I just stumbled across this issue here today. A little while ago I was facing the same problem, so I made a small plugin that allows the thumbnail sizes to be configured. To be honest though, I think this functionality should be included in DokuWiki core.
I updated my plugin today to reflect the latest core changes and it is now available on GitHub:
https://github.com/mightymt/dokuwiki-plugin-customimagesizes