Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Conversation

@silentworks
Copy link
Collaborator

What kind of change does this PR introduce?

Bug fix to get image transforms working.

What is the current behavior?

Currently image transforms aren't being passed over correctly as we are checking for "transform" in the options property while we only have the direct transform properties there.

What is the new behavior?

Added the additional "transform" key to the dict hence allowing the transforms to work correctly.

Additional context

Add any other context or screenshots.

Add download option to get_public_url
@codecov-commenter

This comment was marked as off-topic.

Copy link
Contributor

@J0 J0 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for putting this together! Could you please update the reference spec as well when a slot frees up?

@silentworks
Copy link
Collaborator Author

Yeah I will update the reference docs for all these.

@silentworks silentworks merged commit 64a8ab2 into main Sep 28, 2023
@silentworks silentworks deleted the fix/correct-option-type-for-transforms branch September 28, 2023 09:37
Comment on lines +211 to +234
_query_string = []
download_query = None
if options.get("download"):
download_query = (
"download="
if options.get("download") is True
else f"download={options.get('download')}"
)

if download_query:
_query_string.append(download_query)

render_path = "render/image" if options.get("transform") else "object"
transformation_query = urllib.parse.urlencode(options)
query_string = f"?{transformation_query}" if transformation_query else ""
transformation_query = (
urllib.parse.urlencode(options.get("transform"))
if options.get("transform")
else None
)

if transformation_query:
_query_string.append(transformation_query)

query_string = "&".join(_query_string)
query_string = f"?{query_string}"
Copy link
Contributor

Choose a reason for hiding this comment

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

A little confused by this diff - why are we manually constructing the query string instead of letting urllib.parse.urlencode do the work?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants