Skip to content

Commit

Permalink
2.0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
JayChase committed Mar 8, 2020
1 parent 9b31b07 commit ee09d70
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.0.10

- handle url null in bundled configs

# 2.0.9

- Added classes to picture and imag elements to make more stylable
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-picture",
"version": "2.0.9",
"version": "2.0.10",
"scripts": {
"ng": "ng",
"start": "ng s --vendor-source-map=true",
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-picture/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-picture",
"version": "2.0.9",
"version": "2.0.10",
"repository": {
"type": "git",
"url": "https://github.com/jaychase/ngx-picture.git"
Expand Down
10 changes: 6 additions & 4 deletions projects/ngx-picture/src/lib/cloudinary-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ export function cloudinarySrcInterpolator(
breakpoint: string,
breakpointValue: number
): string {
return `${url.replace(
'upload/',
'upload/w_' + breakpointValue + '/f_' + imageFormat + '/'
)}`;
return url
? `${url.replace(
'upload/',
'upload/w_' + breakpointValue + '/f_' + imageFormat + '/'
)}`
: null;
}

export const CLOUDINARY_CONFIG: NgxPictureConfig<number> = {
Expand Down
8 changes: 5 additions & 3 deletions projects/ngx-picture/src/lib/graph-cms-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ export function graphCmsSrcInterpolator(
breakpoint: string,
breakpointValue: number
): string {
return `https://media.graphcms.com/resize=w:${breakpointValue},fit:scale/output=format:${
imageFormat === 'jpeg' ? 'jpg' : 'webp'
}/${url.replace('https://media.graphcms.com/', '')}`;
return url
? `https://media.graphcms.com/resize=w:${breakpointValue},fit:scale/output=format:${
imageFormat === 'jpeg' ? 'jpg' : 'webp'
}/${url.replace('https://media.graphcms.com/', '')}`
: null;
}

export const GRAPH_CMS_CONFIG: NgxPictureConfig<number> = {
Expand Down
10 changes: 6 additions & 4 deletions projects/ngx-picture/src/lib/imagekit-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ export function imagekitSrcInterpolator(
breakpointValue: number
): string {
const fileName = url.substring(url.lastIndexOf('/'));
return `${url.replace(
fileName,
'/tr:w-' + breakpointValue + ',f-' + imageFormat + fileName
)}`;
return url
? `${url.replace(
fileName,
'/tr:w-' + breakpointValue + ',f-' + imageFormat + fileName
)}`
: null;
}

export const IMAGEKIT_CONFIG: NgxPictureConfig<number> = {
Expand Down

0 comments on commit ee09d70

Please sign in to comment.