Skip to content

Commit

Permalink
Code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija committed Oct 30, 2024
1 parent d24c8ee commit 4ee84d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/ext/kemal_gphoto2.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/gphoto2/web/routes.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ee84d4

Please sign in to comment.