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

Bug fixes relating to image dimensions #19

Merged
merged 4 commits into from
Jan 25, 2022
Merged

Conversation

mehulkaklotar
Copy link
Contributor

@mehulkaklotar mehulkaklotar commented Jan 7, 2022

Requirements

  • Remove double slashes in the file url when rendered
  • A missing string cast causes dimensions to be lost from some SVGs.
  • A bug with srcsets breaks square SVGs entirely in Chrome. - We will not fix it as it crosses with WP.

Description of the Change

  • For newer uploads we have fixed the double slash being added in svg file url
  • Float value casting fix for svgs when fetching width and height.

Alternate Designs

No alternate designs.

Benefits

  • SVG uploaded without viewbox will be rendered properly on front end.

Possible Drawbacks

No drawback.

Verification Process

  • Upload SVG in Media and see that attachment meta has now proper file path which should be 2022/01/FILENAME.svg
  • Float cast of width and height when fetching svg sizes gives correct width and height when rendering.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

#15

Changelog Entry

@mehulkaklotar mehulkaklotar self-assigned this Jan 7, 2022
@mehulkaklotar mehulkaklotar linked an issue Jan 7, 2022 that may be closed by this pull request
@jeffpaul jeffpaul added this to the Future Release milestone Jan 19, 2022
@mehulkaklotar mehulkaklotar marked this pull request as ready for review January 24, 2022 16:36
Copy link
Collaborator

@darylldoyle darylldoyle left a comment

Choose a reason for hiding this comment

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

This looks good to me!

@jeffpaul jeffpaul modified the milestones: Future Release, 1.10.0 Jan 25, 2022
@jeffpaul jeffpaul merged commit 3115e4f into develop Jan 25, 2022
@jeffpaul jeffpaul deleted the fix/15-image-dimentions branch January 25, 2022 19:41
@dkotter dkotter mentioned this pull request Mar 1, 2022
6 tasks
@dkotter dkotter mentioned this pull request Mar 11, 2022
6 tasks
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.

Two bug fixes relating to image dimensions
3 participants