Class: Imagekitio::Resources::Files::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/imagekitio/resources/files/metadata.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Metadata

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Metadata.

Parameters:

API:

  • private



63
64
65
# File 'lib/imagekitio/resources/files/metadata.rb', line 63

def initialize(client:)
  @client = client
end

Instance Method Details

#get(file_id, request_options: {}) ⇒ Imagekitio::Models::Metadata

Some parameter documentations has been truncated, see Models::Files::MetadataGetParams for more details.

You can programmatically get image EXIF, pHash, and other metadata for uploaded files in the ImageKit.io media library using this API.

You can also get the metadata in upload API response by passing metadata in responseFields parameter.

Parameters:

  • The unique fileId of the uploaded file. fileId is returned in the list and s

Returns:

See Also:



25
26
27
28
29
30
31
32
# File 'lib/imagekitio/resources/files/metadata.rb', line 25

def get(file_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/files/%1$s/metadata", file_id],
    model: Imagekitio::,
    options: params[:request_options]
  )
end

#get_from_url(url:, request_options: {}) ⇒ Imagekitio::Models::Metadata

Some parameter documentations has been truncated, see Models::Files::MetadataGetFromURLParams for more details.

Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API.

Parameters:

  • Should be a valid file URL. It should be accessible using your ImageKit.io accou

Returns:

See Also:



49
50
51
52
53
54
55
56
57
58
# File 'lib/imagekitio/resources/files/metadata.rb', line 49

def get_from_url(params)
  parsed, options = Imagekitio::Files::MetadataGetFromURLParams.dump_request(params)
  @client.request(
    method: :get,
    path: "v1/metadata",
    query: parsed,
    model: Imagekitio::,
    options: options
  )
end