File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed
Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,14 @@ describe('Tests for Transformation Action -- Delivery', () => {
215215 expect ( url ) . toBe ( 'https://res.cloudinary.com/demo/image/upload/q_auto/sample' ) ;
216216 } ) ;
217217
218+ it ( 'Can use shortened quality notation' , ( ) => {
219+ const url = createNewImage ( 'sample' )
220+ . delivery ( Delivery . quality ( 'auto:best' ) )
221+ . toURL ( ) ;
222+
223+ expect ( url ) . toBe ( 'https://res.cloudinary.com/demo/image/upload/q_auto:best/sample' ) ;
224+ } ) ;
225+
218226 it ( 'Creates a cloudinaryURL with Delivery.density' , ( ) => {
219227 const url = createNewImage ( 'sample' )
220228 . delivery ( Delivery . density ( 150 ) )
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {FormatQualifier} from "../qualifiers/format/FormatQualifier";
1212import { toFloatAsString } from "../internal/utils/toFloatAsString" ;
1313import { DeliveryColorSpaceFromICC } from "./delivery/DeliveryColorSpaceFromICC" ;
1414import { DeliveryAction } from "./delivery/DeliveryAction" ;
15+ import { QualityTypes } from "../types/types" ;
1516import { ImageFormatType , VideoFormatType } from "../types/types" ;
1617
1718export type IDeliveryAction = DeliveryAction | DeliveryColorSpaceFromICC ;
@@ -74,7 +75,8 @@ function dpr(dpr: string|number):DeliveryAction {
7475 * <b>Learn more:</b> {@link https://cloudinary.com/documentation/image_optimization#how_to_optimize_image_quality | Image quality}
7576 * {@link https://cloudinary.com/documentation/video_manipulation_and_delivery#quality_control | Video quality}
7677 * @memberOf Actions.Delivery
77- * @param {string | number | Qualifiers.Quality } qualityType For a list of supported quality types see {@link Qualifiers.Quality| quality types} for
78+ * @param {QualityTypes | string | number | Qualifiers.Quality } qualityType For a list of supported quality types see
79+ * {@link Qualifiers.Quality| quality types} for
7880 * possible values.
7981 * @return {Actions.Delivery.DeliveryQualityAction }
8082 * @example
@@ -88,7 +90,7 @@ function dpr(dpr: string|number):DeliveryAction {
8890 * quality('auto'),
8991 * );
9092 */
91- function quality ( qualityType :string | number ) :DeliveryQualityAction {
93+ function quality ( qualityType :QualityTypes | string | number ) :DeliveryQualityAction {
9294 return new DeliveryQualityAction ( qualityType ) ;
9395}
9496
Original file line number Diff line number Diff line change 1- import { gif , png , webp } from "../qualifiers/animatedFormat" ;
2-
31export type StreamingProfiles = string | "4k" | "full_hd" | "hd" | "sd" | "full_hd_wifi" | "full_hd_lean" | "hd_lean" ;
42
53export type stringOrNumber = number | string ;
@@ -363,3 +361,14 @@ export interface LegacyITransforamtionOptions {
363361 url_suffix ?: string ;
364362 [ futureKey : string ] : any ;
365363}
364+
365+ export type QualityTypes =
366+ 'auto' |
367+ 'auto:best' |
368+ 'auto:eco' |
369+ 'auto:good' |
370+ 'auto:low' |
371+ 'jpegmini' |
372+ 'jpegmini:best' |
373+ 'jpegmini:high' |
374+ 'jpegmini:medium' ;
You can’t perform that action at this time.
0 commit comments