Skip to content

Instantly share code, notes, and snippets.

View yunruse's full-sized avatar
don't forget to drink some water!

Mia yun Ruse yunruse

don't forget to drink some water!
View GitHub Profile
@ph33nx
ph33nx / batch_image_converter.py
Last active January 10, 2025 04:33
Batch Convert Images to Web-Optimized JPG or WEBP using Python with EXIF Preservation 🖼️✨ Fast, batch image conversion while preserving EXIF metadata using Python Script
#!/usr/bin/env python3
"""
Author: ph33nx
URL: github.com/ph33nx
Description:
This script converts images from various formats (e.g., PNG, JPG, WebP) to either JPG or WebP for web optimization.
It preserves EXIF metadata, allows for optional parameter customization, and handles errors gracefully.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Continent_Name Continent_Code Country_Name Two_Letter_Country_Code Three_Letter_Country_Code Country_Number
Asia AS Afghanistan, Islamic Republic of AF AFG 4
Europe EU Albania, Republic of AL ALB 8
Antarctica AN Antarctica (the territory South of 60 deg S) AQ ATA 10
Africa AF Algeria, People's Democratic Republic of DZ DZA 12
Oceania OC American Samoa AS ASM 16
Europe EU Andorra, Principality of AD AND 20
Africa AF Angola, Republic of AO AGO 24
North America NA Antigua and Barbuda AG ATG 28
Europe EU Azerbaijan, Republic of AZ AZE 31
@karlding
karlding / itunes-artist-photos.md
Created March 3, 2016 05:17
Grab iTunes image artwork from the DOM using the Open Graph meta tags

iTunes Artist Photos

The iTunes API doesn't provide a way to grab artist images, but the iTunes website uses Open Graph meta tags, which embeds a meta tag with a property attribute value set to og:image. As it turns out, this seems to be the same image used in the iTunes artwork.

The URL structure is similar to the artworkUrl values returned by the API, but what concerns us here is the part I've indicated at the end of the URL.

http://is3.mzstatic.com/image/thumb/Music7/v4/68/68/41/68684190-833b-bfb4-5018-e5a2e6f69eb0/source/1200x630bf.jpg
                                                                                                   └─ widthxheight
@mkottman
mkottman / id3.lua
Created August 22, 2011 12:13
An ID3 tag reader implemented in pure Lua. Supports ID3v1 tags and a subset of ID3v2 tags.
--- A simple module to read ID3 tags from MP3 files.
-- Supports ID3v1 tags and a (meaningful) subset of ID3v2 tags.
-- @class module
-- @name id3
-- @author Michal Kottman
-- @copyright 2011, released under MIT license
local id3 = {}
local function textFrame(name)