Skip to content

Commit

Permalink
MBTiles: Fix update with WEBP compression
Browse files Browse the repository at this point in the history
  • Loading branch information
drons committed Feb 22, 2025
1 parent 26fc9a3 commit 5ef87af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frmts/mbtiles/mbtilesdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2870,6 +2870,10 @@ GDALDataset *MBTilesDataset::Open(GDALOpenInfo *poOpenInfo)
{
poDS->m_eTF = GPKG_TF_JPEG;
}
else if (pszFormat != nullptr && (EQUAL(pszFormat, "webp")))
{
poDS->m_eTF = GPKG_TF_WEBP;
}

const char *pszTF =
CSLFetchNameValue(poOpenInfo->papszOpenOptions, "TILE_FORMAT");
Expand All @@ -2879,6 +2883,8 @@ GDALDataset *MBTilesDataset::Open(GDALOpenInfo *poOpenInfo)
if ((pszFormat != nullptr &&
(EQUAL(pszFormat, "jpg") || EQUAL(pszFormat, "jpeg")) &&
poDS->m_eTF != GPKG_TF_JPEG) ||
(pszFormat != nullptr && EQUAL(pszFormat, "webp") &&
poDS->m_eTF != GPKG_TF_WEBP) ||
(pszFormat != nullptr && EQUAL(pszFormat, "png") &&
poDS->m_eTF == GPKG_TF_JPEG))
{
Expand Down

0 comments on commit 5ef87af

Please sign in to comment.