alexfernandez / package-quality

Measurements of quality for packages, especially for npm
MIT License
312 stars 19 forks source link

Add retina support (banner) #46

Closed equinusocio closed 1 year ago

equinusocio commented 8 years ago

Add a retina ready quality banner. Now the banner looks like a s**t on retina display :)

alexfernandez commented 8 years ago

Care to propose a patch?

equinusocio commented 8 years ago

How?

alexfernandez commented 8 years ago

We would need to know why it looks wrong. The existing banner is a SVG so it should scale nicely.

Can you attach a screenshot and a link so we can diagnose the problem first?

equinusocio commented 8 years ago

Not the shield, i mean the banner, this png:

screen shot 2016-09-12 at 10 49 36

http://packagequality.com/#?package=material-theme

The png should be exported @2x on retina display. You can also always use the @2x on a retina/normal display density, for an easy fix. Instead of check the screen density you can always return the @2x (or @3x) png with the @1x size, so you don't have to worry about densities.

alexfernandez commented 8 years ago

Wow, you are right. @tufosa Do you think we can improve it?

tufosa commented 8 years ago

Looks pretty bad. It wasn't me who implemented the client side. Let me have a look at how it's done and see if There is an easy fix.

On Wed, Sep 14, 2016 at 1:27 AM, Alex Fernández notifications@github.com wrote:

Wow, you are right. @tufosa https://github.com/tufosa Do you think we can improve it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alexfernandez/package-quality/issues/46#issuecomment-246858414, or mute the thread https://github.com/notifications/unsubscribe-auth/AFq7RGcWoMPl5EZrRaH9NL4wYkoEQAn4ks5qpzFygaJpZM4J4xsZ .

alexfernandez commented 8 years ago

Was it @sgmonda? What do you think, Sergio?

DiegoTUI commented 8 years ago

@alexfernandez @sgmonda it seems like we need a higher quality app/img/badge2.png, as well as higher quality stars. As @equinusocio pointed out, an easy fix would be to replace our current image resources by 3x quality resources and serve them for all devices. A fine tune of this approach would be to have several quality of images for several resolutions, read the user-agent of the request and serve accordingly. @sgmonda can you provide higher quality images of the badge and stars?

sgmonda commented 8 years ago

@DiegoTUI @alexfernandez @tufosa I've added x2 and x3 versions for badge and stars, and I've implemented a simple way to serve x2 and x3 images, just adding an optional argument size=X to the badge URL. Example:

http://npm.packagequality.com/badge/material-theme.png image

http://npm.packagequality.com/badge/material-theme.png?size=2 image

http://npm.packagequality.com/badge/material-theme.png?size=3 image

I'll leave checking the user agent (or other tricks to avoid having to write the "size" argument) in your hands. NOTE I'm not able to deploy to production. This improvement is pushed but not deployed. Please do it for me. Thanks.

DiegoTUI commented 8 years ago

thanks @sgmonda. I just deployed this last version. Closing the issue.

DiegoTUI commented 8 years ago

Well, I can't close the issue ;-)) @alexfernandez please, test the new features and close it.

alexfernandez commented 8 years ago

I cannot test it, @equinusocio can you let us know if it works for you, or do you need anything else?

equinusocio commented 8 years ago

I still see the non-retina banner.

DiegoTUI commented 8 years ago

@equinusocio are you adding the size parameter to your request? I just checked right now and it seems like it's working:

http://packagequality.com/badge/async.png?size=3

equinusocio commented 8 years ago

But shouldn't be automatic?

thecotne commented 8 years ago

why not serve svg?

alexfernandez commented 8 years ago

Not sure that we have svg for that particular image, but it might be a good solution. @sgmonda, what do you think?

thecotne commented 8 years ago

to help decide about svg here are benefits of it

equinusocio commented 8 years ago

• Extremely Low Size

False. It is not always so.

thecotne commented 8 years ago

minimize "any" svg with svgo take that svg and convert to png and compere size

svg is always smaller then png/jpeg

if you have vector graphics in first place (like stars and check mark ...) i am not saying converting png/jpeg to svg will save you size

thecotne commented 8 years ago

if you drow this in illustrator/inkscape it will be much smaller and much better quality

equinusocio commented 8 years ago

@thecotne But with png you can use compression to get a nice output that can save a lot of KBs, compared to a full detailed SVG. In some cases, when the svg is structured and complex, exporting to jpg (not png) can save a KBs.

There are svg and svg, but in this case you're right. 👍 We can close here this OT. :D

alexfernandez commented 8 years ago

Good idea. Any takers? @equinusocio @thecotne?

thecotne commented 8 years ago

@alexfernandez everything looks simple in badge2.psd but logo is not vector do you have vector version of logo? svg or ai format?

@equinusocio you can minimize svg with svgo and compress with gzip

alexfernandez commented 8 years ago

I do not think we have a SVG version, but I will let @sgmonda answer the question.

thecotne commented 8 years ago

ping @alexfernandez @sgmonda

sgmonda commented 8 years ago

There is no svg version of our image resources. Even if we create it, we cannot support svg badges right now, unless we change the way we build them. We're using a virtual canvas which needs the width and height to compute the final image. That is the reason we've added support for size argument, which just multiplies by 2 or 3 the original size.

Supporting svg badges is a good feature, but nothing trivial right now.

thecotne commented 8 years ago

If you guys provide vector logo i can create svg version of badge and generator script for that

On Mon, Oct 17, 2016, 14:10 Sergio Garcia Mondaray notifications@github.com wrote:

There is no svg version of our image resources. Even if we create it, we cannot support svg badges right now, unless we change the way we build them. We're using a virtual canvas which needs the width and height to compute the final image. That is the reason we've added support for size argument, which just multiplies by 2 or 3 the original size.

Supporting svg badges is a good feature, but nothing trivial right now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alexfernandez/package-quality/issues/46#issuecomment-254167322, or mute the thread https://github.com/notifications/unsubscribe-auth/ABiFUT2KHarPRlXfUC5OOYuun4L2H3Zsks5q00migaJpZM4J4xsZ .

alexfernandez commented 8 years ago

@thecotne We just don't have it. Is anyone able to replicate it in vector form? That would be cool!

Wandmalfarbe commented 7 years ago

I created the logo in vector format (Inkscape-SVG) here #48.

alexfernandez commented 7 years ago

Thanks, @Wandmalfarbe, merged now! @thecotne can you pick it up from here?

thecotne commented 7 years ago

working on it ...

thecotne commented 7 years ago

sorry for delay ...

so far i have this -> https://gist.github.com/thecotne/2a0776c6849cee2ddfbb3b35bc7ac119

(half star has different style)

i could not start package quality locally ... it wants some mongodb running ...

[Sun Apr 09 2017 22:19:53 GMT+0400 (+04)] NOTICE local-config.js not found
[Sun Apr 09 2017 22:19:54 GMT+0400 (+04)] INFO Server listening on port 8080
[Sun Apr 09 2017 22:19:54 GMT+0400 (+04)] ERROR Could not connect to MongoDB: MongoError: failed to connect to server [localhost:27017] on first connect
alexfernandez commented 7 years ago

Not bad. Can you send a PR?

equinusocio commented 7 years ago

@thecotne The green mark is not vertically centered :)

thecotne commented 7 years ago

@equinusocio updated ...

green color was also wrong