Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Cloudinary url gets truncated in Unpic srcset #130

Open
marcob896 opened this issue May 2, 2024 · 1 comment
Open

Dynamic Cloudinary url gets truncated in Unpic srcset #130

marcob896 opened this issue May 2, 2024 · 1 comment

Comments

@marcob896
Copy link

marcob896 commented May 2, 2024

Hi,
I'm effectively using Unpic React in my project but I'm encountering an issue in using a "dynamic url".
An example of such url is the following:

<Image
src='https://res.cloudinary.com/dxfqd0qn4/image/upload/w_1200,h_630,c_fill,f_auto/l_00_excel-dashboard-slicers-filtri-interattivi_vbztau.png/c_scale,fl_relative,w_0.37/fl_layer_apply,g_east,x_50/w_570,h_450,c_fit,co_rgb:FFFFFF,g_west,x_45,y_-50,l_text:montserrat_50_bold:Excel%20Dashboard%3A%20Filtri%20dati%20interattivi%20(slicer)%20per%20tabelle%20e%20grafici%20pivot./og-image-blog-article-template'
width={1200}
height={630}
/>

inspecting with the browser I see that it gets truncated after the dot in pivot. and becomes:

https://res.cloudinary.com/dxfqd0qn4/image/upload/c_fill,w_640,h_384,f_auto/l_00_excel-dashboard-slicers-filtri-interattivi_vbztau.png/c_scale,fl_relative,w_0.37/fl_layer_apply,g_east,x_50/w_570,h_450,c_fit,co_rgb:FFFFFF,g_west,x_45,y_-50,l_text:montserrat_50_bold:Excel%20Dashboard%3A%20Filtri%20dati%20interattivi%20(slicer)%20per%20tabelle%20e%20grafici%20pivot

Strangely, If i use a ts function to generate the url, as I should:

<Image
src={generateOgImage({
title: post.title,
featuredImage: post.featuredImageUrl.slice(
post.featuredImageUrl.lastIndexOf('/') + 1
),
cloudName: 'dxfqd0qn4',
imagePublicID: 'og-image-blog-article-template',
})}
width={1200}
height={630}
/>

it gets truncated after the prevoius dot in w_0.37 and thus becomes:

https://res.cloudinary.com/dxfqd0qn4/image/upload/c_fill,w_640,h_384,f_auto/l_00_ciclo-for-each-macro-excel_kxhmym.png/c_scale,fl_relative,w_0

@marcob896
Copy link
Author

@ascorbic is there anything I can do here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant