Open Maddin-619 opened 2 years ago
Hey @Maddin-619, thanks for the PR! This looks like a nice feature and I'm happy to merge it.
Please add documentation for this feature in the README, the vim docs, and also add a md example.
After finding the right image2ascii (theres also a python command with the same name but different parameters) I found that the width/height issue can also be solved by using the -r
parameter - seems easier as it keeps the aspect ratio?
You are right. This is much more comfortable. Should we drop the with and height in favor of the ratio or should we accept both?
I guess having both would be nice but it would also mean more parsing - no idea whats the best way here, maybe in the form of actual URL GET parameters? Like folder/myimage.jpg?r=9&w=10&h=10
? (ofc all together don't make sense)
I actually had the same issue when I was testing the MR, but I forgot to post it here.
We should also mention what the "right image2ascii version" is and how to install it.
We should also mention what the "right image2ascii version" is and how to install it.
Its actually in the PR notes and the vim manual of this PR, I just didn't rtfm 😅 I knew of "the other" image2ascii and so just assumed thats the one.. Maybe in a second step the command and parameters could even be made variables so one can use the ascii-fier of choice.
@Maddin-619 thanks for the additions. Do you think this is ready to be merged?
I did not implement an exchangable image2ascii program as suggested. Stick with the golang tool for now and this works just fine with optional ratio or with and height params in http query style. So in my opinion this could be merged now, doing the exchangable thing maybe in abother PR.
I recently used this plugin for a presentation in my company and it was so cool. I thought it was nice using some images too, so I made a little patch: If the markdown file includes an image link, the image gets converted with the command line tool image2ascii and centered in the presentation buffer. If the url dosn't exist the alt text gets printed.
In the terminal image2ascii can get the image width and height, but from vim script that didn't worked. So it is necessary to pass the width and height manually. I found a markdown extension where the image size could be passed after the url with an
=
sign prefix, so I used these format:Here is an example. The cover page of my presentation :)![image](https://user-images.githubusercontent.com/19187483/136269324-3de5eaf4-334f-4e7f-a6b1-f2c1f95dadfa.png)
P.S. Since it is October can u please lable this PR that it gets accepted: https://hacktoberfest.digitalocean.com/resources/participation Thank you!