Image download corruption

DaMagics
Non-Fungible Trixie -
Perfect Pony Plot Provider - Uploader of 10+ images with 350 upvotes or more (Questionable/Explicit)
Artist -

Lewd Cuddlehorse :3
Sometimes when using downloaders that use the json API images can corrupt. They are incomplete and show part of the image in black.
 
Example (nsfw!!): https://i.imgur.com/yEgU3FB.png
 
First I thought this was an issue with the download manager(s). But multiple scripts in python and C# result in the same problem.
 
My theory is that this happens because the processing of an upload is incomplete, but the json data is available before the image itself is, and the script that fetches data from images.json will try to download something that isn’t fully available yet.
 
Is this a known issue and is my theory correct? I hope it can be resolved as it is annoying somtimes.
 
Thanks.
byte[]
Solar Supporter - Fought against the New Lunar Republic rebellion on the side of the Solar Deity (April Fools 2023).
Non-Fungible Trixie -
Verified Pegasus - Show us your gorgeous wings!
Preenhub - We all know what you were up to this evening~
An Artist Who Rocks - 100+ images under their artist tag
Artist -

Philomena Contributor
@DaMagics  
That is possible; you might want to try adding created_at.lt:5 minutes ago as a search parameter to avoid that. I’m not sure what else could be doing that.
DaMagics
Non-Fungible Trixie -
Perfect Pony Plot Provider - Uploader of 10+ images with 350 upvotes or more (Questionable/Explicit)
Artist -

Lewd Cuddlehorse :3
@byte[]  
That’s clever. I’ll be testing this to see if it helps.
 
If you ever need technical information I could try. But then I would have to spend some time to try and debug it.
Interested in advertising on Derpibooru? Click here for information!
KilianKuro Commissions!

Help fund the $15 daily operational cost of Derpibooru - support us financially!

Syntax quick reference: **bold** *italic* ||hide text|| `code` __underline__ ~~strike~~ ^sup^ %sub%

Detailed syntax guide