You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using your browser debug option F12 - look at the content type of the file downloaded. I see the following
Save the file. It will save the file as 2009.jpg
Open the file in text editor or hex editor. I see the following
Expected behavior
As the resizing is converting the jpg to a png - I would expect the content type to be image/png
Also if saving the file, I would expect it to save a file called 2009.png instead of 2009.jpg since it is no longer a jpeg.
Desktop (please complete the following information):
Describe the bug
Downloading an image using the following url
https://www.geocat.ch/geonetwork/srv/api/records/b0b45bd3-e556-4641-97e3-641c94ec6567/attachments/2009.jpg?size=320
Will produce the incorrect content type and incorrect filename.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
As the resizing is converting the jpg to a png - I would expect the content type to be
image/png
Also if saving the file, I would expect it to save a file called 2009.png instead of 2009.jpg since it is no longer a jpeg.
Desktop (please complete the following information):
Additional context
Content type is set here.
https://github.com/GeoCat/core-geonetwork/blob/126e92f3a73ed12b933e89e2776e7f45c97b0289/services/src/main/java/org/fao/geonet/api/records/attachments/AttachmentsApi.java#L281
The conversion to PNG is done here
https://github.com/GeoCat/core-geonetwork/blob/126e92f3a73ed12b933e89e2776e7f45c97b0289/services/src/main/java/org/fao/geonet/api/records/attachments/AttachmentsApi.java#L287
So I would expect the content type and content disposition to be set accordingly when changing to png.
The text was updated successfully, but these errors were encountered: