Skip to content

Commit

Permalink
booru/site: Force jpg thumbnail extension on all Gelbooru sites
Browse files Browse the repository at this point in the history
There seems to be a bug with some older versions of Gelbooru 0.2.0,
oddly enough Safebooru seems to have fixed the issue since I
implemented the fix specifically for them.
  • Loading branch information
ahodesuka committed Jun 10, 2021
1 parent 6b01e59 commit efd239a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/booru/site.cc
Original file line number Diff line number Diff line change
Expand Up @@ -921,10 +921,9 @@ Site::parse_post_data(unsigned char* data, const size_t size)
if (has_notes)
notes_url = Glib::ustring::compose(m_Url + NotesURI.at(m_Type), id);

// safebooru.org provides the wrong file extension for thumbnails
// All their thumbnails are .jpg, but their api gives urls with the
// same exntension as the original images exnteion
if (thumb_url.find("safebooru.org") != std::string::npos)
// Some older Gelbooru based sites have a bug where their thumbnail urls file
// extension match the normal file extension even though all thumbnails are .jpg
if (m_Type == Type::GELBOORU)
thumb_url = thumb_url.substr(0, thumb_url.find_last_of('.')) + ".jpg";

date::sys_seconds t;
Expand Down

0 comments on commit efd239a

Please sign in to comment.