class GPhoto2::CameraFile

Included Modules

Defined in:

gphoto2/camera_file.cr

Constant Summary

BUFFER_SIZE = 256 * 1024

Initial buffer size used in #read.

PREVIEW_FILENAME = "capture_preview.jpg"

The preview data is assumed to be a jpg.

UNKNOWN_MIME_TYPE = "unknown/unknown"

The unknown mime type as specified by the libgphoto2.

Constructors

Instance Method Summary

Instance methods inherited from module GPhoto2::Struct(LibGPhoto2::CameraFile)

ptr : Pointer(T) ptr, ptr? : Pointer(T) | Nil ptr?, to_unsafe : Pointer(T) to_unsafe, wrapped : T wrapped

Constructor methods inherited from module GPhoto2::Struct(LibGPhoto2::CameraFile)

new(ptr : Pointer(T) | Nil = nil) new

Constructor Detail

def self.new(camera : GPhoto2::Camera, path : Path | String) #

NOTE allocates memory.


[View source]
def self.new(camera : GPhoto2::Camera) #

NOTE allocates memory.


[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


[View source]
def close : Nil #

NOTE frees allocated memory.


[View source]
def data : Pointer(UInt8) #

Returns pointer file data.


[View source]
def delete : Nil #

Deletes file from the camera.


[View source]
def finalize #

Finalizes object by freeing allocated memory.


[View source]
def folder #

[View source]
def info : CameraFileInfo #

Returns an object containing information about the file.


[View source]
def name #

[View source]
def path : Path #

Returns file path.


[View source]
def preview? #

Returns true if file is a preview.


[View source]
def read : Bytes #

Reads file directly from the camera.


[View source]
def save(path : Path | String = default_filename) : Nil #

Saves file #data at given pathname.


[View source]
def size : UInt64 #

Returns file size (in bytes).


[View source]
def to_s #

Returns file #path.


[View source]
def to_slice : Bytes #

Returns file #data as Bytes.


[View source]