typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 58 forks source link

Auto detect scale and orientation of images #1059

Open gandalfsaxe opened 6 years ago

gandalfsaxe commented 6 years ago

When you paste a screenshot from a retina Mac, it looks double as big as it should. Other apps such as Apple Notes, Notability etc, display 2x images, e.g. screenshots, as they should.

Any chance of this happening?

screen shot 2017-11-20 at 17 30 51
AlexPasternak commented 6 years ago

Just FYI, both Capto and Lightshot will automatically resize 2X Retina screenshots to normal size. Most apps don't handle the full-size ones well, otherwise in my experience, e.g., pasting screenshots into an Outlook message. I never thought that not auto-resizing those images was Outlook's fault though.

abnerlee commented 6 years ago

Apple Notes, Notability are not markdown editors, there are no clean & standard way to scale image in markdown.

We could use <img zoom="50%" /> to scale, but that may not be what user except when they drag images, they may still expect syntax ![]() to be generated automatically.

gandalfsaxe commented 6 years ago

Both Apple Notes and Notability didn't support this feature just a year back or so. Apple Notes added it with Sierra, and Notability a little while after I contacted their support.

Yes image sizing in Markdown is a little bit of a mess / unstandardized. In my opinion it would be best to have automatic use of "" as an option when it's detected that the pasted image is a screenshot - that's how most other notes programs tackle it I think (except that it's default, not an option). I agree that it should probably be an option, not hard implemented since some users may prefer clean Markdown. But I do think it should be the default; I don't know of anyone who would prefer improperly large and blurry images in their notes from screenshots just to keep it "pure markdown", instead of having an HTML tag as a tradeoff for properly shown images.

When image resizing later becomes a standard feature of GFM, it's trivial to search/replace all "" tags with "" syntax, or whatever it will be.

I hope you'll consider this, because for me Typora is all about having the best viewing experience, while still having the flexibility and simplicitet of Markdown under the hood. Pasted screenshots just looks horrible. I understand the need to resist "option creep", but I think this is important.

abnerlee commented 6 years ago

Option is better than default.

It mainly depends on how you use Typora, if you use it for writing notes, image auto resize is good, but if you use it to write posts in readme or jekyll, then you may prefer Typora to be more compatible with other markdown tools

gandalfsaxe commented 6 years ago

I agree it should be an option.

But still, won’t a non-scaled screenshot look weird no matter what context? I.e. blown up / unnaturally big and slightly blurry. l’d only want this 50% autoscaling to apply to paste it screenshots mind you.

perryprog commented 6 years ago

Any update on this? I use Typora for my math notes, and I've found it's especially hopeful to combine this with with macOS Mojave's new image continuity feature to add a drawing to my notes. It's quite a pain to manually change the image url to use the style="zoom: 15%;" format. (I'll probably make it a macro soon)

Personally, I would prefer an option to enable scaling controls on images but I understand that wouldn't be easy to implement.

If there's currently any other solution besides rewriting the ![]() to be <img ...> please let me know.

Edit: As a temporarily solution I'm doing this

image