decaporg / decaporg/decap-cms

Save image in different formats in the media library

Open
#2,808 7 comments 0 reactions 1 assignee Claimed by @mariolopjr View on GitHub
area: media-library kind: feature pinned
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Is your feature request related to a problem? Please describe.**

I am looking to have any number of image transformations in my git repo directly without having an account on a third-party system.

**Describe the solution you'd like**

In my admin/config.yml file it says:

media_folder: 'assets/uploads'

In the admin backend of my, when uploading, say, a 5Mb image called kittens.jpg to my media library, it goes to ./assets/uploads/kittens.jpg, then I can select it when adding it to a post.

Would it be possible to save the image in several sizes?

**Describe alternatives you've considered**

Could we have something like this in admin/config.yml?

media_folder: 'assets/uploads'
image_transformations:
- name: small
format: jpg
quality: 60
width: 100
- name: medium
width: 400
default: true

Then when I upload a 5 Mb "kittens" image, it would automatically create these files:

* ./assets/uploads/kittens.jpg
* ./assets/uploads/_transformations/small/kittens.jpg
* ./assets/uploads/_transformations/medium/kittens.jpg

And, then in my "embed image" widget, there could be an additional field "transformation" which would default to "medium", and that file would then be embedded into my post.

**Additional context**

Alhough Cloudinary and other services can be very useful, for very small projects these might be overkill. My experience with front-end content editors is that often they don't have an appreciation of the importance of keeping image size to a minimum, so automating that in part might be interesting.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.