Thumbnails Image not loading in custom media tab

Vote:
 

Hi Team,

  I have created our custom media tab and binding images from external json. The external json contains the thumbnails image url .

  I am able to load the .jpg thumbinal image but not able to load the .tiff and .png thumbinal image. When I inspect the elements in the browser source the thumbnails image url is dispalying https://****/cms/images/782a3Kk-aj88QHguvgY5oU/?scale=tn?1665476131734 But the correct url is https://****/cms/images/782a3Kk-aj88QHguvgY5oU/?scale=tn. I am not sure why it's appending the extra integer digit for all the thumbinal url. We are not adding anywhere in the code.

#288997
Oct 11, 2022 8:23
Vote:
 

If you manually add this Image type to the asset lib does the preview work ? Could it be a missing mime type ?

Does your .jpg images have the extra attribute being added ?

#288998
Oct 11, 2022 8:38
Vote:
 

Hi Minesh Shah (Netcel)

  Yes, for the .jpg images also extra attribute being added . I am not sure where we have to add mime type. Can you please guide ?

 I have already added below code in the applicaiton.

    [MediaDescriptor(ExtensionString = "jpg,jpeg,jpe,ico,gif,bmp,png,tif")]
    public class GenericMedia : MediaData
    {
        // <summary>
        /// Gets or sets the description.
        /// </summary>
        public virtual string Description { get; set; }
    }

#288999
Oct 11, 2022 9:01
Vote:
 

those random numbers are for cache invalidation. as they are after the question mark, they would be ignored by the browser

#289000
Oct 11, 2022 9:15
Vote:
 

Hi Quan Mai

  Do you have any idea how to avoid this image cache in the custom media tab. I believe thumbinals is broken due to this random numbers.

#289004
Oct 11, 2022 13:15
Vote:
 

I think problem is somewhere else. tested on my machine with Quicksilver and the thumbnails are working fine even with the cache number

#289005
Oct 11, 2022 13:22
Vote:
 

Hi Quan Mai

Any way to prevent cache invalidation ? I am still not able to resolve the issue if do you have any idea please guide me,

#289155
Oct 13, 2022 12:18
Vote:
 

Hi Binay

We have not had to do this and you can try 

Setting Mime Type in .Net Core in Startup.cs

public void Configure(IApplicationBuilder app)
{
    var provider = new FileExtensionContentTypeProvider();
    // Add new mappings
    provider.Mappings[".tif"] = "image/tiff";

I believe the cache invalidation issue is a red herring it should nor interfere with the request. 

If you manually upload an Image (.tif) to the asset library is the preview thumnail working ?

Minesh 

#289156
Oct 13, 2022 14:04
Vote:
 

Minesh Shah (Netcel) Thank you for your reply.

I have tried a different approach and issue get resolved. I have just append the & with the image url. So instead of https://****/cms/images/782a3Kk-aj88QHguvgY5oU/?scale=tn I am using https://****/cms/images/782a3Kk-aj88QHguvgY5oU/?scale=tn& and it's working as expected.

#289161
Oct 13, 2022 14:29
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.