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

fix: crop horizontally when aspect ratio is reduced without width or height #753

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

geigerzaehler
Copy link
Contributor

When the aspect ratio is reduced and no width or height are given the image is now correctly cropped.

Before, if I requested an aspect ratio of 1:2 for an image with dimensions 640x800 it would not change the dimensions of the image. Now the image is correctly cropped to 400x800.

  • Quick Checklist
  • I have read the contributing guidelines
  • I have written new tests, as applicable (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • I have added a changeset, if applicable

Copy link

changeset-bot bot commented Oct 9, 2024

🦋 Changeset detected

Latest commit: cfa18c9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
imagetools-core Patch
vite-imagetools Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.31%. Comparing base (6f2516e) to head (cfa18c9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #753      +/-   ##
==========================================
+ Coverage   93.93%   94.31%   +0.37%     
==========================================
  Files          34       34              
  Lines         791      791              
  Branches      225      226       +1     
==========================================
+ Hits          743      746       +3     
+ Misses         48       45       -3     
Flag Coverage Δ
imagetools-core 94.31% <100.00%> (+0.37%) ⬆️
vite-imagetools 94.31% <100.00%> (+0.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benmccann
Copy link
Collaborator

@geigerzaehler thanks for this. I went through all the dependency updates today and updated vitest to version 2, which changed all the snapshot files. Can you rebase this PR against the latest commit from main, remove your snapshop file, and generate a new one? See #764

Thanks!

@geigerzaehler
Copy link
Contributor Author

Can you rebase this PR against the latest commit from main, remove your snapshop file, and generate a new one? See #764

Of course, done.

@benmccann benmccann merged commit c530897 into JonasKruckenberg:main Nov 27, 2024
7 checks passed
@geigerzaehler geigerzaehler deleted the crop-horizontally branch November 28, 2024 18:45
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