Jump to content

Add a choice in the field of the image type proceeding expansion.


Recommended Posts

For example:
It is necessary for you that all photos in galleries of "participants" would be in jpeg. But different types are allowed for loading, and all of them will be cut off in compliance with the type.
 
I suggest to choose expansion in which the reduced copies of the image will be converted, it can be both control for a field, and expansion for API Image
 
$image->ext() //jpg
$newImage = $image->ext('png')
$newImage->ext() //canonical png convert
Link to comment
Share on other sites

Conversion of image type is more complex than just changing the extension. All the data in the image has to be uncompressed then re-compressed with the new format, and that's something that goes beyond the scope of our image manipulation functions at present. While true that some browsers will recognize a jpg as a jpg regardless of extension (by detecting the type in the image data), the file becomes essentially corrupt as it's no longer consistent with the indicated type.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...