Migrate images to Wikimedia, default to ILI9341_2, refresh image layout#3
Open
haxorthematrix wants to merge 1 commit into
Open
Conversation
Cornell's BirdNET image gallery (https://birdnet.cornell.edu/files/2019/09/...) was removed at some point, so every URL in data/birds.csv now returns 404. This regenerates the CSV against the Wikipedia REST API (984 / 986 species mapped; Moltoni's warbler and Olive sparrow have no JPG illustration on the English Wikipedia and keep placeholder URLs). All URLs use Wikimedia's fixed-width thumbnail pattern at 330px. Defaults the platformio.ini display driver to ILI9341_2_DRIVER (the original micro-USB ESP32-2432S028R CYD variant) and removes the TFT_RGB_ORDER=TFT_BGR override that was needed only for the ST7789 path. The README's variant-swap instructions are updated to match. Bird-detail screen rendering now: - Reads the cached JPG's dimensions via TJpgDec.getFsJpgSize() and picks the smallest power-of-2 scale that fits a 200x180 image canvas, then centers the result inside that canvas. - Background-clears the canvas on every cycle (previously only on the no-image fallback path), so swapping between landscape, square, and portrait Wikipedia thumbnails no longer leaves stale pixels. - Repositions TMLabel / RSLabel right of the wider image canvas and vertically centers TMLabel with the image. Adds a .gitignore for .pio/, .vscode/, and the local birds.csv.*-backup artifacts produced during the image-source migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
|
Thanks for this. It'll take me a couple of days to get to processing this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
https://birdnet.cornell.edu/files/2019/09/...URLs) has been taken down — every URL in the olddata/birds.csvnow returns 404. This PR regenerates the CSV against the Wikipedia REST API: 984 of 986 species are mapped to Wikimedia thumbnails at the 330px fixed width. The two remaining species (Moltoni's warbler, Olive sparrow) have no JPG illustration on their English Wikipedia article and keep placeholder URLs.ILI9341_2_DRIVERinplatformio.ini— correct for the original micro-USBESP32-2432S028RCYD variant — and theTFT_RGB_ORDER=TFT_BGRline (which was only needed by the ST7789 path) is removed. The README's variant-swap step is updated to match.src/main.cppnow usesTJpgDec.getFsJpgSize()to read each cached JPG's actual dimensions and picks the smallest power-of-2 scale (1, 1/2, 1/4, 1/8) that fits a 200×180 canvas, then draws the result centered. The canvas is background-cleared on every cycle (previously only on the no-image fallback path), so swapping between landscape, square, and portrait thumbnails no longer leaves stale pixels at the edges.TMLabelis repositioned right of the wider image canvas and vertically centered with the image;RSLabelshifts with it..gitignoreadded for.pio/,.vscode/, and localbirds.csv.*-backupartifacts.Why 330px?
Wikimedia only serves thumbnails at a fixed allow-list of widths ({60, 120, 250, 330, 500, ...}). 330 was chosen because TJpg_Decoder's
setJpgScale(2)renders it to ~165px wide — large enough to fill most of the 200×180 canvas without overflowing, and small enough that very tall portrait crops can still down-scale to 1/4 if needed.Test plan
espressif32 6.11.0with the bundledframework-arduinoespressif32 3.20017.241212ILI9341_2_DRIVERpio run -t uploadfsTMLabel("X minutes ago") is vertically centered with the image and does not overlap itST7789_DRIVERper the updated README step 3🤖 Generated with Claude Code