Should $core_v2_ui.GetPreviewImageUrl and $core_v2_ui.GetPreviewHtml give the same result?

I have an example where for media gallery entries the two preview methods are not consistent and I wanted the image url rather than the preformatted html output 

So for example the media url is 

localhost/.../Verint-PPA-v3.pptx

If I use GetPreviewUrl

I get back the mage type icon

localhost/.../pptx.png

But if I use GetPreviewHtml I correctly get a preview of the doc 

<span class="doc-preview-preview" style="width: 100px; height: 100px;"><img src="">localhost/.../1.72.png_2D00_100x100x2.png class="doc-preview-preview-type">PPTX</span></span>

Should these give consistent results ? 

To test this I edited the core media gallery file list widget as below 

<p>00 $media.File.FileUrl</p>
<p>11 $core_v2_ui.GetPreviewImageUrl($media.File.FileUrl)</p>
</p>$!core_v2_ui.GetPreviewHtml($media.File.FileUrl, "%{width=100,height=100}")


  • In many cases, these APIs will return similar results.

    GetPreviewHtml() retrieves the HTML directly from the associated file viewer for the URL or file type of the provided URL. It may be an image but could be any valid HTML.

    GetPreviewImageUrl() attempts to retrieve the preview HTML from the associated file viewer and extract image-only responses (potentially wrapped in a link). If the preview HTML does not consist only of an image, it will return a file-type appropriate preview image. GetPreviewImageUrl() will always return an image URL regardless of whether there is an available file viewer or not.

    Because the PPTX file you tested with is rendered by the document viewer and document viewer renders a preview with more markup than just an image, it it currently falling back to a file-type image to ensure that a valid image is returned from GetPreviewImageUrl().