1. The scene

During the development process, friends may also have some problems that a picture cannot be displayed properly

2. Follow up analysis

1) at first thought it was a picture is too big to load down, but wait for a long time did not come out, the printed picture address http:// * * * * * * * * * * * * * * * * *. PNG? x-oss-process=image/resize,w_500,h_663/quality,q_90/watermark,image_d2F0ZXJtYXNrLnBuZz94LW9zcy1wcm9jZXNzPWltYWdlL3Jlc2l6 ZSxQXzEwMCx3XzUwMCxoXzY2Mw,g_center,t_90

After communication with the background, WE found that the h5 was uploaded as a stream file, so we could not get the file address, which was returned to us as a download address, and we need to download and render it first. These SDWebimages are processed.

2) This URL link is very strange. It shows that the file is in PNG format, but when it is downloaded, it is in WebP format. After communication with the test students, the feedback is that they changed the suffix of the image forcibly.

3) First, SDWebImage was used to try loading, but the expected effect was not achieved, then YYImage was still not loaded, and finally, Afnetworking was used to download the file and render it, but it still failed, so I guess the link is not formal.

4) Error message is printed. The binary file given by the background is webP format, but the suffix of the image is.png

The same mistake has been found online, and the way to deal with it is to convert the image type

3. Solutions

After negotiation with the background, since the background cannot give us the file address that we do not need to download, we should add a layer of format operation when watermarking the image processing part, and transfer the image according to the suffix when uploading (it does not affect Android after testing), so as to ensure the unity of the real type of the image and the link suffix to solve this problem. At the same time, I also want to remind the colleagues who upload pictures to upload pictures formally. Finally, I hope the background upload can verify the real type of files not only through the suffix verification.