Description of the need
This came from reading several other issues about various problems with image uploads, and realizing that we do not have a dedicated form API element for images. We currently have only file and file_managed.
Images usually need different validation criteria than generic files, including * image type validation * image dimension validation
In most places in core, these are added manually to every file upload field used only for images. A new image form API element would make it easier for core developers change all image API elements at once. For example, adding a file type validation that used a site-wide set of allowed image types:
* https://github.com/backdrop/backdrop-issues/issues/4937 and
* https://github.com/backdrop/backdrop-issues/issues/4998
There are also other image-only upload locations in core, such as the site logo and favicon (and there may be others).
Proposed solution
Add a new image form api element, that is identical to file but with additional validators.
Alternatives that have been considered
Helper functions that could be used to determine a default set of allowed file types, based on the operating system and modules.
Draft of feature description for Press Release (1 paragraph at most)
Backdrop now includes a new form API element specifically for images, that will natively support all image types supported by your system.
Recent comments
OK, @izmeez, well I have just created a Virtual Machine running Ubuntu 24 and installed the same Backdrop Site as is on the Laptop and It is working fine, so there must be something odd about...
Write Permission Problems on files, ../private and /tmp on my Laptop
Nope, SELinux is not installed. I am running Ubuntu with the KDE Plasma Desktop. Aparmour is enabled by default on both machines I have enabled another site on the Laptop and am...
Write Permission Problems on files, ../private and /tmp on my Laptop
Is this an SELinux issue where you have to also make sure the SELinux permissions are set correctly?
Write Permission Problems on files, ../private and /tmp on my Laptop