Re: WKWebView does not load images


Gerriet M. Denkmann
 

On 7 Oct 2017, at 03:52, Steve Christensen <punster@...> wrote:

Is /path/to/myImage.gif a full path or a partial path? I ask because you didn’t specify a base URL.
htmlString actually looks like:

<base href=“file:/absolut/path/to/PicturesFolder/“ />

<img alt=“alternate” src=“./image67.gif" />


I also tried (following the suggestion from Jens):
<img alt=“alternate” src=“file:///absolut/path/to/PicturesFolder/image67.gif” />
Still no picture.


Do the path components have the correct case if the image is on a case-sensitive volume?
Yes, they have. And yes, the volume is case-sensitive.


Also, both:
[ self.webView loadHTMLString: htmlString baseURL: nil ];
and
[ self.webView loadHTMLString: htmlString baseURL: urlTo “/“ ];
give the same result.




On Oct 6, 2017, at 7:58 AM, Gerriet M. Denkmann <g@...> wrote:

[ wkWebView loadHTMLString: htmlString baseURL: nil ];

htmlString contains: …<img alt=“alternate” src=“/path/to/myImage.gif” /> ….

WKWebView just shows a rectangle containing: “alternate”.

WebView shows the picture.

Are there any special steps needed to make WKWebView show images?

Gerriet.

Join cocoa@apple-dev.groups.io to automatically receive all group messages.