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

Image format #48

Closed
hpatoio opened this issue Mar 22, 2016 · 4 comments
Closed

Image format #48

hpatoio opened this issue Mar 22, 2016 · 4 comments

Comments

@hpatoio
Copy link

hpatoio commented Mar 22, 2016

AFAIK only PNG images are allowed in pkpass files.

I was using this library and I tried to add JPG images but were not showed up. The library should throw an exception if non PNG image is added. Do you agree ? I've already a draft for this I can send a PR

@eymengunay
Copy link
Owner

Hi @hpatoio,

I'd prefer keeping image validation logic outside of this library as the validation process might become a little too complex. Do we just check the file extension, what happens if somehow the file extension is wrong etc.

However, I guess a simple extension check won't hurt anybody ;)

@g-
Copy link
Collaborator

g- commented Mar 22, 2016

I'd go for the simple file extension check. I definitely wouldn't try to validate the image itself.

I've started a PassValidator class to check for common (and frustrating) errors which cause the pass to just not work. This might be a good place for this kind of check.

@hpatoio
Copy link
Author

hpatoio commented Mar 23, 2016

@g- that's why I wanted to add some sort of validation. I wasted hours because I was adding JPG isntead of PNG. When you open a not valid pass file the iPhone doesn't show any error message. It simply doesn't load the pass (or part of it)

@g- g- closed this as completed in d9e1015 Mar 23, 2016
@hpatoio
Copy link
Author

hpatoio commented Mar 23, 2016

Thanks ! Let's tag a new minor release !

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

3 participants