twMediaDownloader
twMediaDownloader copied to clipboard
Save the image’s alt-text to its EXIF data
As the title says, if the images in a tweet contain alt-text, this change will try to record it as part of the image’s EXIF data (using https://github.com/hMatoba/piexifjs ). It only works for JPG images, but support for writing PNG comments or other formats can be added fairly easily.
Additionally, this makes a slight improvement to Tweetdeck support. Sometimes, when Tweetdeck displays images of a tweet (e.g. in Notifications), the images in the DOM don’t have alt-text, but clicking on the tweet to expand it re-renders it with alt-text. This change calls update_stored_tweet_info
as part of the click handler, to make sure the DOM gets rescanned with the latest info. It would be better to change this part to fetch the tweet info via the API, like the main_react script does, but that’s a larger change…