Developer forum

Forum » Templates » GetImage ashx and html

GetImage ashx and html

Roop K. Rusbjerg
Reply

Hello,

Has anyone experienced issues with the GetImage.ashx in html files?
It seems work better with cshtml.

Or is there another trick for it to work?

I'm having issues with images not showing in safari on iphones, when using GetImage.ashx in html files.
And changing the files to cshtml doesn't seem to help either.

A little help please :)

Best regards,

Roop


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Roop,

 

We've used that in the past without any issues. Can you share the src value (generated image path with GetImage.ashx)?

 

Best Regards,

Nuno Aguiar

 
Roop K. Rusbjerg
Reply

Hello Nuno,

Here's the link: 

<img src="/Admin/Public/GetImage.ashx?Image=<!--@ItemPublisher:Item.FilterFoto-->&Format=jpg&Width=350&Height=220&Crop=0&DoNotUpscale=1&fillcanvas=1" class="nyheds-img img-responsive" />

Best regards,

Roop

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Roop,

 

And does the tag return any value?

And what happens if you open the src in a new tab?

 

You should have the image be rendered in the browser. There is no apparent reason for GetImage to work differently between html or cshtml.

 

Nuno

 
Nicolai Pedersen
Reply

Remember to use the UrlEncoded() extension for your tag

Instead of: ?Image=<!--@ItemPublisher:Item.FilterFoto-->

Use this: ?Image=<!--@ItemPublisher:Item.FilterFoto.UrlEncoded()-->

See docs: https://doc.dynamicweb.com/template-tags/introduction/extensions/encoding-extensions

 
Roop K. Rusbjerg
Reply

Hello Nicolai and Nuno

It works fine on all browsers on PC but not on my iPhone.

(It might somthing to do with the site being a bank test site so the connection to the server might not be allowed.)

I will test some more.

Thank you both for replying :)

Best regards,

Roop

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Sounds good Roop

 

Happy coding!

 

You must be logged in to post in the forum