devicons / devicon

Set of icons representing programming languages, designing & development tools
https://devicon.dev
MIT License
9.32k stars 2.27k forks source link

[FEATURE REQUEST] Make a bot/worflow which responds with a preview of .eps files if they exist in a PR #1453

Open Snailedlt opened 1 year ago

Snailedlt commented 1 year ago

I have searched through the issues and didn't find my problem.

Problem

There are quite a few PRs that include .eps files with the original unedited icons in it. It would be nice if it was possible to see a preview of it without opening it up locally.

Possible Solution

Maybe we could make a github bot/workflow which opens the file and takes a screenshot of the content, then posts it as a comment? We should be able to reuse the code from our peek-bot for the image upload and commenting part, so the hardest issue to figure out would be how to open up the file and screenshot the content

Additional information

I'm not sure how hard this is to implement, but it would be very valuable for us maintainers. Currently we either have to spend quote some time opening up and reviewing the .eps file, or just trusting it looks fine and accept the PR. So a preview would make the PR review process quicker and more robust.

Snailedlt commented 1 year ago

Related [vscode extension]() to preview .eps files: https://github.com/ahnafnafee/PostScript-Preview

It's pretty bare-bones, but it works: image

Snailedlt commented 1 year ago

Possible tools we could use:

Snailedlt commented 1 year ago

I haven't been successful in getting .eps file syntax highlighting for devicon's .eps files inside of vscode, even with the PostScript Language extension. image image

I suspect the reason is one of these:

  1. The encoding is wrong, and I just haven't been able to find the right one yet.
  2. The file is corrupt
  3. The file is a non-editable version

If it's one of the last two, we might need some guides on how to create and upload .eps files, so that they are editable and not corrupted.

Any input here is helpful

lunatic-fox commented 1 year ago

Reason 3 ✔

Once you save a file as an EPS, you can no longer edit it. If you notice any mistakes and want to make edits, you’ll need to return to the original design file to make your changes before resaving the EPS.

Source: Adobe Creative Cloud - EPS files.

​1 Input

We can locally convert .eps to .svg using Inkscape, but we will need to install Ghostscript first. Here's the tutorial made by Open Source Bug: Youtube - IMPORT EPS IN INKSCAPE ON WINDOWS | Open File Tutorial

Extending tutorial - In Inkscape

We can preview .svg files quite easier in VS Code by SVG extension.

​2 Input

Since it's a public project, maybe it's possible to use Cloud convert - EPS to SVG API.


I like the little demo of PostScript-Preview extension, but didn't install it yet. About the online preview options, personally, PostScript Viewer is the best followed by EPS Viewer.

Snailedlt commented 1 year ago

Seems like the software you need to open and edit .eps files depend on which software made the .eps file to start with: https://www.quora.com/How-do-I-open-and-edit-an-EPS-file/answer/Monika-Gause

Question:

How do I open and edit an EPS file?

Answer:

Depends on what kind of EPS it is.

Vector EPS: any vector application that can fully handle CMYK

EPS saved by Adobe Illustrator: Adobe Illustrator, because the EPS might contain a fully editable AI file

Raster based EPS: Photoshop, because Photoshop is able to edit those specific prepress features a raster based EPS might have

I'd say this is most likely a very accurate answer, seing as Monica Guase (the person who wrote the answer) has 15 years of experience writing books about Adobe Illustrator:

Screenshot_20221103_093903

Since most EPS images made for devicons are made with adobe illustrator we might be in deep water here :/ But there's hope, since Inkscape supports both .eps and .ai files: https://inkscape.org/learn/faq/#what-formats-can-inkscape-importexport

lunatic-fox commented 1 year ago

​3 Input

I used Cloud convert - EPS to SVG and I noticed that the .svg file was generated by Inkscape, so that make me think: "It must have a CLI version." And it actually does! 🤩

After playing with it for a while I came to this result:

* Some paths from terminal are hidden.

https://user-images.githubusercontent.com/76992016/200136191-789ea299-6aec-413d-8aa3-0257f3e7588c.mp4

Requirements:

Operational system: Windows 10