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

image presets can now be arrays #2150

Open
wants to merge 3 commits into
base: 1.9/develop
Choose a base branch
from

Conversation

mumnik
Copy link
Contributor

@mumnik mumnik commented Oct 9, 2020

Image presets can now be organised better:

Model_Event_Image::TYPE_BANNER => [
			'175x175' => [
				'quality' => 100,
				'actions' => [
					['crop_resize', 175, 175]
				],
			],
			'1250x750' => [
				'quality' => 100,
				'actions' => [
					['crop_resize', 1250, 750]
				],
			]
		],

		Model_Event_Image::TYPE_AVATAR => [
			'175x175' => [
				'quality' => 100,
				'actions' => [
					['crop_resize', 175, 175]
				],
			],
...

@WanWizard
Copy link
Member

Can you provide an update for the docs too?

@mumnik
Copy link
Contributor Author

mumnik commented Oct 10, 2020

This patch came from the following problem:
I've faced the problem of the image storage organisation, I need to upload the images to CDN in particular sizes. Each type of image may have various sizes (for mobile version, desktop, various data representations, etc). Adding array as an argument to the preset loader allows to loop through the presets and process images in a more simple way.

Yes, I can sure can update docs. Will do.

config/image.php Outdated
@@ -22,7 +22,7 @@
*
*/

return array(
Copy link
Member

Choose a reason for hiding this comment

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

Coding standards, no short array notation please.

@WanWizard
Copy link
Member

Thanks.

Now the only thing still missing is

Yes, I can sure can update docs. Will do.

This new feature has to go in https://github.com/fuel/docs/blob/1.9/develop/classes/image.html somewhere.

I haven't seen a PR for this yet?

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