File from archive.org: https://archive.org/download/AphexTwinBOACAphex/AphexTwinBOACAphex_archive.torrent
The torrent poster appears to be a zero-byte .jpg image. Let's not use a zero-byte image.

In other words, it's better if the default blue gradient background is used in this case.
Hello,
first contribution here so let me know if I can do anything differently.
I added a quick call to fs.syncStat on the poster to check the filesize after it gets saved, if it isn't zero-sized I save it as posterURL.

Hopefully this is what was expected.
@gdelavald Since torrentPoster creates a Buffer, wouldn't it be faster to just check buf.length == 0? Of course, I'm assuming that a 0 byte file would have a 0 byte buffer. If not, then your solution would be the only way. I'm checking that out now.
Looks like the buffer size is indeed 0! @gdelavald, where/how did you find the default blue gradient image? I can't find it anywhere. Let me know, and I'll spin up a PR for this issue.
EDIT: Figured out that preventing it from creating the file works fine. I decided to have function torrentPosterFromVideo in lib/torrent-poster.js create an error if the buffer has no data. PR incoming.
@AgentEpsilon in the function torrentPosterSaved it updates torrentSummary.posterURL as the posterPath, so if you don't update, when the function renderTorrent calls for the poster path it doesn't find the file and can't add it to the background image, leaving it as the default blue gradient.
This solution feels like exploiting a bug...
@gdelavald Nah, when it executes the poster-related functions, they change the current poster from the default. Therefore, if those functions fail, the current poster never gets changed, leaving it as the default.
TL;DR It's not a bug, it's a feature.
Sorry it took so long, still kinda a git newb :smiley:
Thanks for working together to fix this @gdelavald聽and @AgentEpsilon. Nice work!