How many questions do I have about uploading images on my website? After the upload, the upload may be saved as 1314152... how many questions do I have about uploading images on my website?
The method for storing uploaded images is to save them directly according to the original suffix. php only copies the uploaded 0-hour files during file upload. Therefore, the format of the original upload format is maintained, for example
After the source image is uploaded to JPG, it can be saved as 13141520.jpg.
Can I save it as a suffix?
Will it change the source file? Will the original MD5 change? Is there any damage? Will it cause a format error?
You can directly change the suffix to save the Code. For example, if jpg is transcoded to png, how can this problem be solved?
In the local operating system, if you change the suffix of an image, it seems that there will be no problems in saving it. Who can explain the file name to me?
Thank you! ^_^
Reply content:
How many questions do I have about uploading images on my website?
The method for storing uploaded images is to save them directly according to the original suffix. php only copies the uploaded 0-hour files during file upload. Therefore, the format of the original upload format is maintained, for example
After the source image is uploaded to JPG, it can be saved as 13141520.jpg.
Can I save it as a suffix?
Will it change the source file? Will the original MD5 change? Is there any damage? Will it cause a format error?
You can directly change the suffix to save the Code. For example, if jpg is transcoded to png, how can this problem be solved?
In the local operating system, if you change the suffix of an image, it seems that there will be no problems in saving it. Who can explain the file name to me?
Thank you! ^_^
1. Other formats can be saved. In fact, the file format is not changed, so the md5 value will not change.
2. If you want to change an image to another format, it must be transcoded. images smaller than 20 mb support synchronous operations, that is:
Url? ImageMogr2/format /..
Example:
Jpg format:
Http://7xmz3r.com5.z0.glb.qiniucdn.com/20151203%2FFi85UYGcE_Vs1aJ0NcRt9iul_ISW.jfif-tbnl
Transcoding to webp:
Http://7xmz3r.com5.z0.glb.qiniucdn.com/20151203%2FFi85UYGcE_Vs1aJ0NcRt9iul_ISW.jfif-tbnl? ImageMogr2/format/webp
You can convert it to webp format.