Issues with image fetch consistency

OneBiglotus
OneBiglotus Member Posts: 2
edited March 2023 in Developer APIs

Hello all!


I've been stuck with this issue for a month and a half and I can't figure out what's causing it.

I have been wanting to run tournaments on my server on discord using cloudinary to generate rosters. I wanted to run a few tests before making a more complex system so I threw together a welcome banner to see if it was possible.

It's been a month and I've been experiencing issues with certain member's profile pictures not embedding properly, and I can't seem to figure out why.

Here's the transformation I'm working with:

"https://res.cloudinary.com/yiffhub/image/fetch/r_max/h_150,w_150/f_gif/u_sources:images:defaultbanner/fl_layer_apply,g_west,x_-50/l_text:sources:fonts:PermanentMarker.ttf_25:Welcome%20To%20ServerName%20" $username "!,co_rgb:ffffff,x_100,w_400,fl_no_overflow,c_fit/" $user

EDIT: both $username and $user are variables from discord. $user is the user's avatar.


Here's an example output:

If there's a better way to do this, I'm all ears. I just need it to convert all .webp format images that are fetched to .gif images.


Here's an example of a working profile picture





And one that doesn't work at all






I've tried this with f_auto, and it doesn't seem to work either. The returning image cannot embed if it is a .webp.



Any help is appreciated thank you so much!

Answers

  • Tamara
    Tamara Member, Cloudinary Staff Posts: 123

    Hi there,

    Thanks for the additional details.

    Basically, using the `f_format` parameter should return the format you specify, so this is the right way to do it, and there shouldn't be a problem specifying the names as strings. 

    How are you generating the URLs?

    Looking forward to hearing from you,

    Regards,

    Tamara

  • OneBiglotus
    OneBiglotus Member Posts: 2

    Then I'm really at a loss, since all it is doing is inputting the link, and the name in place of the variables in the code. 80% of the time it works, and the others either my embed doesn't work at all, or there is no image to embed. I'll experiment with running the URL through urlscape and see if that fixes the problem.