core icon indicating copy to clipboard operation
core copied to clipboard

image presets can now be arrays

Open mumnik opened this issue 4 years ago • 3 comments

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]
				],
			],
...

mumnik avatar Oct 09 '20 21:10 mumnik

Can you provide an update for the docs too?

WanWizard avatar Oct 09 '20 23:10 WanWizard

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.

mumnik avatar Oct 10 '20 06:10 mumnik

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?

WanWizard avatar Oct 20 '20 14:10 WanWizard