From 4ee84d4c33f21399734fbd319301a17af28e4a29 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Wed, 30 Oct 2024 14:35:57 +0100 Subject: [PATCH] Code comments --- src/ext/kemal_gphoto2.cr | 3 +++ src/gphoto2/web/routes.cr | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ext/kemal_gphoto2.cr b/src/ext/kemal_gphoto2.cr index e093e24..6ea8ae6 100644 --- a/src/ext/kemal_gphoto2.cr +++ b/src/ext/kemal_gphoto2.cr @@ -152,10 +152,13 @@ def send_file(env, file : GPhoto2::CameraFile, *, format : ImageOutputFormat?, f str << case when is_same_format + # original extension unchanged (jpeg) path.extension when path.extension.chars.select!(&.letter?).all?(&.uppercase?) + # new extension keeping original uppercase (JPG) format.extension.upcase else + # new extension (jpg) format.extension end end diff --git a/src/gphoto2/web/routes.cr b/src/gphoto2/web/routes.cr index f41ba79..5c72810 100644 --- a/src/gphoto2/web/routes.cr +++ b/src/gphoto2/web/routes.cr @@ -34,7 +34,6 @@ end get "/cameras/:id/preview" do |env| id = env.params.url["id"] - # NOTE: might be good to use queue here GPhoto2::Web.camera_by_id(id) do |camera| send_file env, camera.preview end