tardypad / sailfishos-daily-comics

Daily comic strips reader for SailfishOS
MIT License
12 stars 17 forks source link

Adding erzaehlmirnix comic #93

Closed Olf0 closed 4 years ago

Olf0 commented 4 years ago

Because I recently started to read the erzaehlmirnix comic strips, I really would like to be able to do so in DailyComics (which I am using daily for years).

Hence started some research:

First I wanted to see, if the strips proper (i.e. in some bitmap format) can be easily extracted from Twitter (I originally had doubts) and ended up with this piece of shell code for experimenting:

URL="https://mobile.twitter.com/erzaehlmirnix/media/grid"
URL="https://mobile.twitter.com/erzaehlmirnix/media/grid?idx=0"
SRC="$(curl -sS "$URL" | sed -n '/div class="card-photo"/,/\/div/p' | fgrep img | grep -o 'src="https.*"' | cut -f 2 -d '"' | cut -f 1-2 -d ":")"
SIZE=large
SIZE=medium
SIZE=small
curl -sSo "${SIZE}-$(echo "$SRC" | rev | cut -f 1 -d "/" | rev)" "$SRC:$SIZE"
ls -l *.png

So I consulted the detailed Addition of new comic info page:

While I seem to have the technical basics done and may now start to create an erzaehlmirnix logo from either logo-qpCYyk3_400x400 (source) or the last panel of a recent, typical strip (e.g., small-ERKZsSZXkAIqe09 (and use that strip as example file, too)) finally exported in JPEG format, I wonder if it really makes sense to continue working on this, due to the denoted requirement for the daily strip proper being in JPEG format: It is only available as PNG.

Can anyone clarify if that statement is still an unconditional requirement, or if DailyComics can also handle PNGs?

Olf0 commented 4 years ago

That was easier than expected, see PR #95:

P.S.: Still I wonder, why the local files ought to be in JPEG format, especially as this requires the color value from the info.json to be manually set for the background of the cover*.jpg and creates visible compression artifacts around edges with harsh contrasts (e.g., text!). Allowing local files in PNG format would alleviate this due to its transparency support (hence the background color can be automatically set according to the color value from info.json) and lossless compression (still often resulting in similar file sizes as an JPEG).

Olf0 commented 4 years ago

Done, see PR #95 (first try, from Twitter) and the current PR #105 (now from Facebook).