Issue with Image Resizing After Downloading via External URL in Novulo Media Component

We have imported media for products using external URLs. We are utilizing component M3622 (R108) Novulo Media for Product and System, where media is downloaded from an external URL and converted to an internal image. Example URL: https://host.provider.com/application/e/b/r/samsungtv.jpg. The image is then saved with the filename “samsungtv.jpg.”

However, after downloading the images, we are unable to resize them, resulting in the following error message:

After adding the “Mime type” column, we noticed that the type is being set as “application/octet-stream.” This issue occurs inconsistently, as many images are processed correctly with the mime type “image/jpeg,” allowing the resizing to function as expected.

When we download the image and upload it directly, resizing works fine. Could it be that the download from the URL is not functioning properly? Or is there another way within Novulo where we can modify or adjust the mime type automatically, as manual changes are not an option?

Thanks in advance for your thoughts

Hi Stephan,

I cannot make a lot out of the provided information, so I cannot give you definitive answer without investigating first. Can you provide:

  • The (integrated) model number of your application
  • Possibly, a process name thats triggered (or steps to reproduce is fine also)
  • Possible ways to trigger the requests/processes that produce the behaviour you say above
  • The source of an image that is supposedly saved improperly.

After I look at the above i could get a better idea of what is happening.

Greetings,
Miroslav

1 Like

Hi Miroslav,

I understand. The model number of our application is: 10144.

I’ve checked the download process, and it’s related to the process: M3622 - R108 Novulo Media bij Product en Systeem. The process name is: “Download media from URL and convert to internal.”

You can simulate the download by going to Overviews - Media by Products - and searching for the product description, for example, SAMSUNG QE65Q73DATXXN. Change the source type to external, leave the media field empty, and use the following external URL: https://red-tickets.ams3.digitaloceanspaces.com/salables/n/r/f/nrfq5hczmo6r.png. This will download and convert the image locally, but the MIME type will still be “application/octet-stream.”

For generating different sizes, go to Media, find the Samsung TV image, and click Generate.

This triggers the process: “N_Media - Generate other sizes in bulk.” I hope this provides you with more information.

Hi Stephan,

I had a look at the process you mention as well as the example you give.

It uses the FileExtensions GetFileFromUrl action. When the GetFileFromUrl creates the file record, it uses the provided with the response “Content-Type” header value to set the mime type, in the provided example png - the server replies that the content type of the response (which contains the png) is “application/octet-stream”.
In the image below you can see the example you gave + another jpg I managed to find, which contains “Content-Type: image/jpg” in the response from the server, in that case the mime type is set accordingly

Then, the reason why you cannot resize those images comes from the process component N_Media - Generate other size and format - this one checks for the usual image mime types, but does not for octet-stream, so it tells you it cannot make the conversion because the file.mimetype is not among the accepted ones.

I see 2 possible approaches to solve this issue:

  • fix it in the process component (M3358) - to also check if mime type is octet stream AND file extension is a image one (.jpg, .png etc.), the imaging plugin should be capable to handle the file as it is
  • Do a change in the file extensions plugin - extend the get file from url action to make a guess what the file mime type is
    • I do dislike this approach a bit - technically its the server’s fault in this case that it doesn’t specify the exact mime-type, however this mime-type check is easier & cleaner done in the plugin than a component.

Could you please raise an SR for plugin product “File Extensions” ? Then I can plan it in and i can think of a proper solution.

Greetings,
Miroslav