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

gm background option matcher is too strict #25

Open
Munter opened this issue May 15, 2017 · 4 comments
Open

gm background option matcher is too strict #25

Munter opened this issue May 15, 2017 · 4 comments

Comments

@Munter
Copy link
Collaborator

Munter commented May 15, 2017

https://github.com/papandreou/express-processimage/blob/master/lib/getFilterInfosAndTargetContentTypeFromQueryString.js#L90

background uses the fill syntax:

    name               (named color)
    #RGB               (hex numbers, 4 bits each)
    #RRGGBB            (8 bits each)
    #RRRGGGBBB         (12 bits each)
    #RRRRGGGGBBBB      (16 bits each)
    #RGBA              (4 bits each)
    #RRGGBBAA          (8 bits each)
    #RRRGGGBBBAAA      (12 bits each)
    #RRRRGGGGBBBBAAAA  (16 bits each)
    rgb(r,g,b)         (r,g,b are decimal numbers)
    rgba(r,g,b,a)      (r,g,b,a are decimal numbers)

See http://www.graphicsmagick.org/GraphicsMagick.html#details-fill

@Munter
Copy link
Collaborator Author

Munter commented May 16, 2017

Color names are the one provided in gm convert -list color

@papandreou
Copy link
Owner

papandreou commented May 16, 2017

I guess /^[A-Za-z]+\d*$/ will be sufficient?

@Munter
Copy link
Collaborator Author

Munter commented May 16, 2017

I'm not entirely sure of gm's behavior with invalid inputs. Throwing would not be nice. Silent error probably also not so nice. Only matching on a whitelist would at least give a possibility to discover that the option wasn't recognized (how I noticed the missing syntaxes in the first place)

@papandreou
Copy link
Owner

I'm not entirely sure of gm's behavior with invalid inputs

Try adding a test :)

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

2 participants