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

Add gif support #3

Merged
merged 6 commits into from
May 7, 2021
Merged

Add gif support #3

merged 6 commits into from
May 7, 2021

Conversation

cemonel
Copy link
Contributor

@cemonel cemonel commented Apr 28, 2021

No description provided.

@cemonel cemonel requested a review from fergalwalsh April 28, 2021 17:33
prism/app.py Outdated
raise NotFound()
if extension == '.gif' and request.args.get('out', 'gif') == 'gif':
customer = self.get_customer(request)
return redirect(core.get_s3_url(customer.read_bucket_name, customer.read_bucket_region, path))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be up here? Can it be below, just above if args['command'] == 'info':?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that was the first place I put it, but here args = parse_args(path, request) function does some validations like width or height is required. For basic .gif case we don't need that.

If the duplicate declaration of get_customer() method is the concern, we may call it before the if extension == '.gif' and request.args.get('out', 'gif') == 'gif': line. But, here I just don't wanted to break the existing flow of calling the get_customer method if all validations are done successfully.

Copy link
Contributor

@fergalwalsh fergalwalsh Apr 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validations like width or height is required. For basic .gif case we don't need that.

We don't actually want to change this behavior. At least not for the gif case specifically. We just want gifs to work with the same parameters as passed for any other image. Right now a width or height is required so the same should be true when serving gifs, even if they do nothing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, right, I will move it as you suggested.

@cemonel cemonel requested a review from fergalwalsh May 3, 2021 08:20
Copy link
Contributor

@fergalwalsh fergalwalsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you.

@fergalwalsh fergalwalsh merged commit 436b451 into main May 7, 2021
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

Successfully merging this pull request may close these issues.

2 participants