Skip to content
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

[Feature Request] Resize an image with a single value/parameter and maintain width/height ratio #2965

Closed
mtHuberty opened this issue Apr 3, 2019 · 1 comment

Comments

@mtHuberty
Copy link

Current behavior

I see that image resizing has been implemented here: this issue. Currently it seems that you must specify both image dimensions: width x height as seen below:
![2b5a9eda.png](:storage/7abc5357-46c8-4fe2-a18d-658427191360/2b5a9eda.png =400x450)

Expected behavior

We should be able to resize images using either a single number (probably corresponding to width) and have the height autoscale to maintain the original images width/height ratio. An example would look like this:
![2b5a9eda.png](:storage/7abc5357-46c8-4fe2-a18d-658427191360/2b5a9eda.png =400)

Alternatively

You could provide a numeric multiplier and have it resize based on that, such as 2 for 2x bigger, 0.5 for half the size etc. Example:
![2b5a9eda.png](:storage/7abc5357-46c8-4fe2-a18d-658427191360/2b5a9eda.png =0.75x)

Current resizing should still work

If two numbers are separated by an x, as in the current syntax for resizing images ![2b5a9eda.png](:storage/7abc5357-46c8-4fe2-a18d-658427191360/2b5a9eda.png =<number>x<number>), the current resize functionality should continue to work as intended.

Steps to reproduce

Try resizing an image in Boostnote! =)

Environment

  • Version : Version 0.11.15 (0.11.15)
  • OS Version and name : MacOS High Sierra 10.13.4 (17E199)
@mtHuberty
Copy link
Author

mtHuberty commented Apr 3, 2019

On digging deeper, I found this discussion which outlines that single dimension specification is in fact implemented already. I just couldn't find it anywhere in the documentation either for boostnote or the markdown-it-imsize npm module that implemented image resizing for markdown projects like Boostnote. The proper syntax is as follows:

To specify an image size by width (auto scaling height)

[image.png](:storage\path\to\image.png =300x)

To specify an image size by height (auto scaling width)

[image.png](:storage\path\to\image.png =x300)

Thanks! I will close this issue.

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

1 participant