Skip to content

Commit

Permalink
Make CameraFileInfo::{File,Preview}#{width,height} return signed int
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija committed Jul 25, 2024
1 parent aec17f0 commit 8959cd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/gphoto2/camera_file_info/file.cr
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ module GPhoto2
end

# Returns the width in pixels.
def width : UInt32?
wrapped.width.to_u32 if field?(:width)
def width : Int32?
wrapped.width.to_i32 if field?(:width)
end

# Returns the height in pixels.
def height : UInt32?
wrapped.height.to_u32 if field?(:height)
def height : Int32?
wrapped.height.to_i32 if field?(:height)
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions src/gphoto2/camera_file_info/preview.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ module GPhoto2
include GPhoto2::ManagedStruct(LibGPhoto2::CameraFileInfoPreview)

# Returns the width of the preview.
def width : UInt32?
wrapped.width.to_u32 if field?(:width)
def width : Int32?
wrapped.width.to_i32 if field?(:width)
end

# Returns the height of the preview.
def height : UInt32?
wrapped.height.to_u32 if field?(:height)
def height : Int32?
wrapped.height.to_i32 if field?(:height)
end
end
end
Expand Down

0 comments on commit 8959cd2

Please sign in to comment.