diff --git a/CHANGELOG.md b/CHANGELOG.md index c10b566..6db73a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ A new data shape, to be served at `/v2/…` next to v1. Not live yet; v1 is unch - No loan programs. New: PCSO (Medical Assistance Program) and DOH (MAIFIP). - A `null` or empty value means "Not available". +### Images +- PhilHealth, SPMC Cancer Institute and AMUMA now use images hosted by this API (`/images/…`, WebP) instead of links to other sites. AMUMA has a new image: `amuma.webp` replaces `amuma.jpg`. +- Image standard ([images/README.md](images/README.md)): WebP; doctor photos square up to 800 × 800, other images 16:9 up to 1200 × 675. `npm run validate` warns about images that are not WebP. +- Images for PCSO and DOH are ready for v2. + ### Docs - Added [MILESTONES.md](MILESTONES.md) and this changelog. - README is now a short quick start. The full API reference moved to [API-GUIDE.md](API-GUIDE.md), and how the API is served and maintained to [MAINTAINING.md](MAINTAINING.md). diff --git a/data/FinancialInstitution/FinancialInstiData.json b/data/FinancialInstitution/FinancialInstiData.json index 26ae7fe..c4f1d99 100644 --- a/data/FinancialInstitution/FinancialInstiData.json +++ b/data/FinancialInstitution/FinancialInstiData.json @@ -4,7 +4,7 @@ { "id": 1, "name": "PhilHealth", - "bgImageURL": "https://newsfortph.com/upload/media/posts/2022-07/10/philhealth-davao-region-intensifies-konsulta-campaign_1657399553-b.jpg", + "bgImageURL": "/images/FinancialInstitution/philhealth.webp", "source": "https://www.philhealth.gov.ph/", "description": "PhilHealth is the Philippines' government-owned health insurer, providing universal health coverage through a social insurance program. It pools funds from member contributions to subsidize medical costs, making healthcare affordable for hospitalizations and preventive care.", "type": "Public Institution", diff --git a/data/HealthInstitution/HealthInstiData.json b/data/HealthInstitution/HealthInstiData.json index d843576..fc58e68 100644 --- a/data/HealthInstitution/HealthInstiData.json +++ b/data/HealthInstitution/HealthInstiData.json @@ -4,7 +4,7 @@ { "id": 1, "name": "SPMC Cancer Institute", - "bgImageURL": "https://media.assettype.com/sunstar%2F2025-09-20%2F08lzbtjf%2FUntitled-1.jpg", + "bgImageURL": "/images/HealthInstitution/spmc-cancer-institute.webp", "source": "https://www.facebook.com/SouthernPhilippinesMedicalCenter", "description": "The Southern Philippines Medical Center is the largest government hospital under the Department of Health of the Republic of the Philippines. It is located at the JP Laurel Ave, Bajada, Davao City. It began as the Davao Medical Center. Its name was changed on November 19, 2009, by Republic Act 9792.", "type": "Public Institution", diff --git a/data/SupportGroups/SupportGroupsData.json b/data/SupportGroups/SupportGroupsData.json index 36368e2..da5e9c4 100644 --- a/data/SupportGroups/SupportGroupsData.json +++ b/data/SupportGroups/SupportGroupsData.json @@ -7,7 +7,7 @@ "description": "AMUMA is a non-stock, non-profit foundation based in Davao City, Philippines. We are a group of dynamic and caring individuals committed to meeting the spiritual, emotional, and practical needs of cancer patients, their families and caregivers, by providing holistic care and support through building and maintaining a healing center for education, counseling, networking, and empowerment.", "type": "General Support Groups", "socmedURL": "https://www.facebook.com/amumasupport", - "bgImageURL": "/images/SupportGroups/amuma.jpg", + "bgImageURL": "/images/SupportGroups/amuma.webp", "location": "Davao City", "longitude": null, "latitude": null, diff --git a/images/Feeds/.gitkeep b/images/Feeds/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/images/FinancialInstitution/.gitkeep b/images/FinancialInstitution/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/images/FinancialInstitution/doh.webp b/images/FinancialInstitution/doh.webp new file mode 100644 index 0000000..f4c510c Binary files /dev/null and b/images/FinancialInstitution/doh.webp differ diff --git a/images/FinancialInstitution/pcso.webp b/images/FinancialInstitution/pcso.webp new file mode 100644 index 0000000..b0cdc38 Binary files /dev/null and b/images/FinancialInstitution/pcso.webp differ diff --git a/images/FinancialInstitution/philhealth.webp b/images/FinancialInstitution/philhealth.webp new file mode 100644 index 0000000..ef5b4dd Binary files /dev/null and b/images/FinancialInstitution/philhealth.webp differ diff --git a/images/HealthInstitution/.gitkeep b/images/HealthInstitution/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/images/HealthInstitution/spmc-cancer-institute.webp b/images/HealthInstitution/spmc-cancer-institute.webp new file mode 100644 index 0000000..3f4a297 Binary files /dev/null and b/images/HealthInstitution/spmc-cancer-institute.webp differ diff --git a/images/MedicalSpecialist/.gitkeep b/images/MedicalSpecialist/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/images/README.md b/images/README.md index 184e0f4..65b3ee1 100644 --- a/images/README.md +++ b/images/README.md @@ -3,6 +3,21 @@ Images here are served by the API at `/images//`, for example `images/MedicalSpecialist/dr-santos.webp` → `https://cancer-open-data.capillanesjohnfritz.workers.dev/images/MedicalSpecialist/dr-santos.webp`. +## Standard (use this for every new image) + +| Kind | Folder | Shape and size | File name | +|---|---|---|---| +| Doctor photo | `MedicalSpecialist/` | Square **1:1**, up to **800 × 800** px | `dr--.webp`, e.g. `dr-felycette-gay-lapus.webp` | +| Institution logo or building | `FinancialInstitution/`, `HealthInstitution/` | Wide **16:9**, up to **1200 × 675** px | `.webp`, e.g. `philhealth.webp` | +| Support group logo or photo | `SupportGroups/` | Wide **16:9**, up to **1200 × 675** px | `.webp`, e.g. `amuma.webp` | +| Feed cover | `Feeds/` | Wide **16:9**, up to **1200 × 675** px | `feed-.webp`, e.g. `feed-1.webp` | + +- **Format: WebP**, quality about 80. It is the smallest for the same quality, keeps transparency for logos, and works in every current browser. +- **Size:** aim under **200 KB** (photos) and **300 KB** (wide images). +- **Never enlarged:** a smaller original keeps its size (same shape). A logo far from 16:9 (tall or square) is padded with its own background color; one close to 16:9 is only trimmed at its plain edges. +- **Center the subject** so apps can crop to a circle (doctors) or a card (wide images). +- Other types still pass the check but get a warning. Convert them to WebP before adding. + ## Rules (checked by `npm run validate`) - **One folder per dataset:** `Feeds/`, `FinancialInstitution/`, `HealthInstitution/`, `MedicalSpecialist/`, `SupportGroups/`. No files loose in `images/`, no sub-folders. diff --git a/images/SupportGroups/amuma.jpg b/images/SupportGroups/amuma.jpg deleted file mode 100644 index 0bbc7c9..0000000 Binary files a/images/SupportGroups/amuma.jpg and /dev/null differ diff --git a/images/SupportGroups/amuma.webp b/images/SupportGroups/amuma.webp new file mode 100644 index 0000000..0ac6202 Binary files /dev/null and b/images/SupportGroups/amuma.webp differ diff --git a/scripts/validate.mjs b/scripts/validate.mjs index 51820b4..9cee27d 100644 --- a/scripts/validate.mjs +++ b/scripts/validate.mjs @@ -96,6 +96,7 @@ for (const f of listImageFiles()) { } else if (f.size > MAX_BYTES) { console.error(`FAIL ${at}: ${kb(f.size)} is over the ${kb(MAX_BYTES)} limit. Resize or compress it`); failed++; } else { if (f.size > WARN_BYTES) warn(`${at} is ${kb(f.size)}. Under ${kb(WARN_BYTES)} loads faster (try WebP, about 1200 px wide)`); + if (!f.rel.endsWith(".webp")) warn(`${at} is not WebP. The standard is WebP (see ${IMAGES_DIR}/README.md)`); images.add(f.rel); } }