[online_image] Fix printf format; comment fixes (#8607)

This commit is contained in:
Clyde Stubbs 2025-04-23 18:47:15 +10:00 committed by GitHub
parent 33d79e03d9
commit 89b1b12993
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -111,7 +111,7 @@ void OnlineImage::update() {
case ImageFormat::BMP: case ImageFormat::BMP:
accept_mime_type = "image/bmp"; accept_mime_type = "image/bmp";
break; break;
#endif // ONLINE_IMAGE_BMP_SUPPORT #endif // USE_ONLINE_IMAGE_BMP_SUPPORT
#ifdef USE_ONLINE_IMAGE_JPEG_SUPPORT #ifdef USE_ONLINE_IMAGE_JPEG_SUPPORT
case ImageFormat::JPEG: case ImageFormat::JPEG:
accept_mime_type = "image/jpeg"; accept_mime_type = "image/jpeg";
@ -121,7 +121,7 @@ void OnlineImage::update() {
case ImageFormat::PNG: case ImageFormat::PNG:
accept_mime_type = "image/png"; accept_mime_type = "image/png";
break; break;
#endif // ONLINE_IMAGE_PNG_SUPPORT #endif // USE_ONLINE_IMAGE_PNG_SUPPORT
default: default:
accept_mime_type = "image/*"; accept_mime_type = "image/*";
} }
@ -159,7 +159,7 @@ void OnlineImage::update() {
ESP_LOGD(TAG, "Allocating BMP decoder"); ESP_LOGD(TAG, "Allocating BMP decoder");
this->decoder_ = make_unique<BmpDecoder>(this); this->decoder_ = make_unique<BmpDecoder>(this);
} }
#endif // ONLINE_IMAGE_BMP_SUPPORT #endif // USE_ONLINE_IMAGE_BMP_SUPPORT
#ifdef USE_ONLINE_IMAGE_JPEG_SUPPORT #ifdef USE_ONLINE_IMAGE_JPEG_SUPPORT
if (this->format_ == ImageFormat::JPEG) { if (this->format_ == ImageFormat::JPEG) {
ESP_LOGD(TAG, "Allocating JPEG decoder"); ESP_LOGD(TAG, "Allocating JPEG decoder");
@ -171,7 +171,7 @@ void OnlineImage::update() {
ESP_LOGD(TAG, "Allocating PNG decoder"); ESP_LOGD(TAG, "Allocating PNG decoder");
this->decoder_ = make_unique<PngDecoder>(this); this->decoder_ = make_unique<PngDecoder>(this);
} }
#endif // ONLINE_IMAGE_PNG_SUPPORT #endif // USE_ONLINE_IMAGE_PNG_SUPPORT
if (!this->decoder_) { if (!this->decoder_) {
ESP_LOGE(TAG, "Could not instantiate decoder. Image format unsupported: %d", this->format_); ESP_LOGE(TAG, "Could not instantiate decoder. Image format unsupported: %d", this->format_);
@ -185,7 +185,7 @@ void OnlineImage::update() {
this->download_error_callback_.call(); this->download_error_callback_.call();
return; return;
} }
ESP_LOGI(TAG, "Downloading image (Size: %d)", total_size); ESP_LOGI(TAG, "Downloading image (Size: %zu)", total_size);
this->start_time_ = ::time(nullptr); this->start_time_ = ::time(nullptr);
} }