Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: Add thumbnail size setter #277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
larsoner opened this issue Jul 30, 2017 · 7 comments
Closed

ENH: Add thumbnail size setter #277

larsoner opened this issue Jul 30, 2017 · 7 comments

Comments

@larsoner
Copy link
Contributor

It looks like the thumbnail dimensions are static:

https://github.com/sphinx-gallery/sphinx-gallery/blob/master/sphinx_gallery/gen_rst.py#L357

I'm happy to add it as a conf.py key (thumbnail_size tuple?) if people agree it would be useful.

@Titan-C
Copy link
Member

Titan-C commented Jul 31, 2017

Thumbnails are of fixed size and rather big(compared to the gallery thumbnail size) as on scikit-learn they were used on other places in their docs(the carousel for example).

I'm not sure about adding this extra setter. But if we go for it, I might say start clustering it with other options for the thumbnail, like the default image. Something like

'gallery_thumbnails':{'default': 'no_image.png', 'size': (200, 140),'broken':'broken_example.png'}

Of course that would break backwards compatibility. As we have the default image as a separate key. But in this way we could expose those defaults to the config rather than setting them up inside the codebase. Then this default will also be more discoverable and help with #276

@choldgraf
Copy link
Contributor

It sounds like @Titan-C is suggesting that using CSS to resize images would be a decent solution, is that right?

@Titan-C
Copy link
Member

Titan-C commented Jul 31, 2017

We already resize with CSS. My guess is @Eric89GXL wants to set a new smaller size on the Thumbnail, so save on space as the thumbnail images is larger than the saved size. Otherwise, if it is on the aesthetics of the thumbnail, yes changing CSS at will is the easiest and can be done on the user side.

@larsoner
Copy link
Contributor Author

larsoner commented Jul 31, 2017 via email

@choldgraf
Copy link
Contributor

were you able to figure this out w/ CSS? (and if so can we close this?)

@larsoner
Copy link
Contributor Author

larsoner commented Aug 1, 2017 via email

@larsoner
Copy link
Contributor Author

larsoner commented Aug 2, 2017

CSS isn't sufficient, I have opened a different bug report about that (#282). Closing this one to move discussion there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants