Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ jobs:
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
strategy:
matrix:
msrv: [1.65.0] # due to let-else
name: ubuntu / ${{ matrix.msrv }}
msrv: [1.83.0] # due to icu_collections@2.1.1
name: ubuntu / ${{ matrix.msrv }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ name = "cloudinary"
description = "A Rust library for the Cloudinary API"
license = "MIT OR Apache-2.0"
keywords = ["cloudinary", "api", "image", "video", "upload"]
version = "0.8.1"
version = "0.8.2"
edition = "2021"
rust-version = "1.65.0" # due to let-else
rust-version = "1.83.0" # due to icu_collections@2.1.1
repository = "https://github.com/Lurk/cloudinary_rs"


[dependencies]
anyhow = "1.0.89"
chrono = "0.4.38"
itertools = "0.13.0"
anyhow = "1.0.100"
chrono = "0.4.42"
itertools = "0.14.0"
mime = "0.3.17"
reqwest = { version = "0.12.24", features = [
"json",
"multipart",
"stream",
"rustls-tls",
] }
serde = { version = "1.0.210", features = ["derive", "rc"] }
serde_json = "1.0.128"
serde = { version = "1.0.228", features = ["derive", "rc"] }
serde_json = "1.0.145"
sha1 = "0.10.6"
tokio = { version = "1.40.0", features = ["rt", "macros"] }
tokio-util = "0.7.12"
url = "2.5.2"
tokio = { version = "1.48.0", features = ["rt", "macros"] }
tokio-util = "0.7.17"
url = "2.5.7"

[dev-dependencies]
dotenv = "0.15.0"
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ CLOUDINARY_CLOUD_NAME_1=***

## Minimum supported Rust version

The minimum supported Rust version for this crate is 1.65
MSRV: 1.83


License: MIT OR Apache-2.0
2 changes: 1 addition & 1 deletion src/transformation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Image {

match self.get_format() {
Some(format) => {
let file_name = self.public_id.split('/').last().unwrap().to_string();
let file_name = self.public_id.split('/').next_back().unwrap().to_string();

let new_file_name = format!("{}.{}", file_name, format);
url.set_path(
Expand Down
40 changes: 20 additions & 20 deletions src/upload/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ pub enum OptionalParameters {
/// **NOTE:**
///
/// - The public ID value for images and videos should not include a file extension. Include
/// the file extension for raw files only.
/// the file extension for raw files only.
/// - Can be up to 255 characters, including:
/// - non-English characters
/// - periods `.`
/// - forward slashes `/`
/// - underscores `_`
/// - hyphens `-`
/// - [Public ID](OptionalParameters::PublicId) values cannot begin or end with a space or forward slash `/`.
/// Additionally, they cannot include the following characters: `? & # \ % < > +`
/// Additionally, they cannot include the following characters: `? & # \ % < > +`
PublicId(String),
/// A string or path that's automatically prepended to the public_id with a forward slash. The
/// value can contain the same characters as the public_id including additional forward
Expand Down Expand Up @@ -159,11 +159,11 @@ pub enum OptionalParameters {
/// Possible values for each access type:
///
/// - token requires either Token-based access or Cookie-based access for accessing the asset.
/// For example: access_type: "token"
/// For example: access_type: "token"
/// - anonymous allows public access to the asset. The anonymous access type can optionally include start and/or
/// end dates (in ISO 8601 format) that define when the asset is publicly available. Note that you can only
/// include a single 'anonymous' access type.
/// For example: `access_type: "anonymous", start: "2017-12-15T12:00Z", end: "2018-01-20T12:00Z"`
/// end dates (in ISO 8601 format) that define when the asset is publicly available. Note that you can only
/// include a single 'anonymous' access type.
/// For example: `access_type: "anonymous", start: "2017-12-15T12:00Z", end: "2018-01-20T12:00Z"`
AccessControl(String),
/// Allows the asset to behave as if it's of the authenticated 'type' (see above) while still using the default
/// 'upload' type in delivery URLs. The asset can later be made public by changing its access_mode via the
Expand Down Expand Up @@ -275,7 +275,7 @@ pub enum OptionalParameters {
///
/// - Returned metadata for images includes: PixelsPerUnitX, PixelsPerUnitY, PixelUnits, Colorspace, and DPI.
/// - Returned metadata for audio and video includes: audio_codec, audio_bit_rate, audio_frequency, channels,
/// channel_layout.
/// channel_layout.
/// - Additional metadata for video includes: pix_format, codec, level, profile, video_bit_rate, dar.
///
/// (In .NET SDK, parameter name is Metadata.)
Expand Down Expand Up @@ -326,14 +326,14 @@ pub enum OptionalParameters {
/// Set to:
///
/// - \<content-aware model>_[\<version>] (e.g. coco_v2) to return a list of detected content using the
/// [Cloudinary AI Content Analysis add-on](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#automatic_image_tagging).
/// Can be used together with the auto_tagging parameter to apply tags automatically.
/// [Cloudinary AI Content Analysis add-on](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#automatic_image_tagging).
/// Can be used together with the auto_tagging parameter to apply tags automatically.
/// - `captioning` to analyze an image and suggest a caption based on the image's contents.
/// - `iqa` to analyze the quality of an image.
/// - `adv_face` to return a list of facial attributes using the Advanced Facial Attribute Detection add-on.
/// - `aws_rek_face` to return a list of detected celebrities and facial attributes using the Amazon Rekognition
/// Celebrity Detection add-on. Can be used together with the `auto_tagging` parameter to apply
/// tags automatically.
/// Celebrity Detection add-on. Can be used together with the `auto_tagging` parameter to apply
/// tags automatically.
///
/// Relevant for images only.
/// TODO: Better type
Expand Down Expand Up @@ -427,10 +427,10 @@ pub enum OptionalParameters {
/// Automatically remove the background of an image using an add-on.
///
/// - Set to cloudinary_ai to use the deep-learning based
/// [Cloudinary AI Background Removal add-on](https://cloudinary.com/documentation/cloudinary_ai_background_removal_addon#removing_the_background_on_upload_update). NOTE: this feature has been superseded by
/// [background removal on the fly](https://cloudinary.com/documentation/cloudinary_ai_background_removal_addon#removing_the_background_on_the_fly).
/// [Cloudinary AI Background Removal add-on](https://cloudinary.com/documentation/cloudinary_ai_background_removal_addon#removing_the_background_on_upload_update). NOTE: this feature has been superseded by
/// [background removal on the fly](https://cloudinary.com/documentation/cloudinary_ai_background_removal_addon#removing_the_background_on_the_fly).
/// - Set to pixelz to use the human-powered
/// [Pixelz Remove-The-Background Editing add-on service](https://cloudinary.com/documentation/remove_the_background_image_editing_addon).
/// [Pixelz Remove-The-Background Editing add-on service](https://cloudinary.com/documentation/remove_the_background_image_editing_addon).
///
/// Relevant for images only.
///
Expand All @@ -439,14 +439,14 @@ pub enum OptionalParameters {
/// Generates a related file based on the uploaded file.
///
/// - Set to `aspose` to automatically create a PDF or other image format from a `raw` Office document using the
/// [Aspose Document Conversion add-on](https://cloudinary.com/documentation/aspose_document_conversion_addon).
/// (Asynchronous)
/// [Aspose Document Conversion add-on](https://cloudinary.com/documentation/aspose_document_conversion_addon).
/// (Asynchronous)
/// - Set to `google_speech` to instruct the
/// [Google AI Video Transcription](https://cloudinary.com/documentation/google_ai_video_transcription_addon)
/// add-on to generate an automatic transcript raw file from an uploaded video. (Asynchronous)
/// [Google AI Video Transcription](https://cloudinary.com/documentation/google_ai_video_transcription_addon)
/// add-on to generate an automatic transcript raw file from an uploaded video. (Asynchronous)
/// - Set to `extract_text` to extract all the text from a PDF file and store it in a `raw` JSON file with a
/// public ID in the format: `[pdf_public_id].extract_text.json`. The full URL of the generated JSON file is
/// included in the API response. (Synchronous)
/// public ID in the format: `[pdf_public_id].extract_text.json`. The full URL of the generated JSON file is
/// included in the API response. (Synchronous)
///
/// See also:
/// [Converting raw files](https://cloudinary.com/documentation/upload_parameters#uploading_non_media_files_as_raw_files).
Expand Down