Skip to content

Conversation

@deluxetom
Copy link
Contributor

@deluxetom deluxetom commented Jan 2, 2025

@deluxetom deluxetom changed the title Use cover method from Intervention Use cover method from Intervention Jan 2, 2025
@deluxetom deluxetom changed the title Use cover method from Intervention #420 - Use cover method from Intervention Jan 6, 2025
@deluxetom deluxetom changed the title #420 - Use cover method from Intervention Use cover method from Intervention Jan 6, 2025
@deluxetom
Copy link
Contributor Author

@ADmad I've been using this update with a project already, the documentation for glide could also be updated to add fit=cover

@ADmad
Copy link
Collaborator

ADmad commented Jan 6, 2025

the documentation for glide could also be updated to add fit=cover

Sounds good to me, would you like to take care of that?

@deluxetom
Copy link
Contributor Author

the documentation for glide could also be updated to add fit=cover

Sounds good to me, would you like to take care of that?

I think I can get started on the 3.0 docs, it looks like its not done yet

@ADmad
Copy link
Collaborator

ADmad commented Jan 6, 2025

Docs for 3.0 already exist and should be up to date unless I missed something https://github.com/thephpleague/glide/tree/3.x/docs/3.0

@deluxetom
Copy link
Contributor Author

Docs for 3.0 already exist and should be up to date unless I missed something https://github.com/thephpleague/glide/tree/3.x/docs/3.0

my bad, I was looking at the master branch :) I'll update the docs for the fit parameter

@deluxetom
Copy link
Contributor Author

@ADmad this is ready for review


~~~ html
<img src="kayaks.jpg?w=300&h=300&fit=crop-25-75">
<img src="kayaks.jpg?w=300&h=300&fit=cover-25-75">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this be crop-25-75. For numeric values for position we use runCropReize() right?

- `fill`: Resizes the image to fit within the width and height boundaries without cropping or distorting the image, and the remaining space is filled with the background color. The resulting image will match the constraining dimensions.
- `fill-max`: Resizes the image to fit within the width and height boundaries without cropping but upscaling the image if it's smaller. The finished image will have remaining space on either width or height (except if the aspect ratio of the new image is the same as the old image). The remaining space will be filled with the background color. The resulting image will match the constraining dimensions.
- `stretch`: Stretches the image to fit the constraining dimensions exactly. The resulting image will fill the dimensions, and will not maintain the aspect ratio of the input image.
- `crop`: Resizes the image to fill the width and height boundaries and crops any excess image data. The resulting image will match the width and height constraints without distorting the image. See the [crop](api/crop/) page for more information.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should keep the crop option stating it's an alias for cover.

@ADmad
Copy link
Collaborator

ADmad commented Jan 7, 2025

Just to confirm using fit=crop or fit=crop-<string>-<string> would still work right? Internally runCoverResize() would be used.

runCropReize() would be used only fit=crop-<numeric>-<numeric> is used, right?

@deluxetom
Copy link
Contributor Author

Just to confirm using fit=crop or fit=crop-<string>-<string> would still work right? Internally runCoverResize() would be used.

runCropReize() would be used only fit=crop-<numeric>-<numeric> is used, right?

that's correct, crop and crop-$position will use runCoverResize() now, they're aliases of cover and cover-position.
crop-<numeric>-<numeric> remains the same

@ADmad
Copy link
Collaborator

ADmad commented Jan 20, 2025

@deluxetom Can you please address the couple of comments I had left for the docs page updates.

@deluxetom
Copy link
Contributor Author

@ADmad updated!

@ADmad ADmad merged commit e1bc3af into thephpleague:3.x Jan 20, 2025
7 checks passed
@deluxetom deluxetom deleted the 3.x-cover branch January 20, 2025 18:34
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