Error loading image via headless API in commerce

Markus Frietsch, modified 1 Year ago.

Error loading image via headless API in commerce

New Member Posts: 5 Join Date: 5/23/24 Recent Posts

I am trying to use an existing image from the document library as an image in a commerce product. I use the following endpoint for this: http://localhost:8080/o/headless-commerce-admin-catalog/v1.0/products/58558/images/by-url

The process works fine and without errors if I have previously loaded the image manually into the document library. However, if I load the image into the document library via the API, the above call fails and the log shows:

liferay        | 2024-08-01 06:40:50.103 WARN  [http-nio-8080-exec-4][ResponseProcessCookies:130] Invalid cookie header: "Set-Cookie: COOKIE_SUPPORT=true; Max-Age=31536000; Expires=Fri, 01 Aug 2025 06:40:50 GMT; Path=/; HttpOnly". Invalid 'expires' attribute: Fri, 01 Aug 2025 06:40:50 GMT

liferay        | 2024-08-01 06:40:50.106 WARN  [http-nio-8080-exec-4][ResponseProcessCookies:130] Invalid cookie header: "Set-Cookie: GUEST_LANGUAGE_ID=en_US; Max-Age=31536000; Expires=Fri, 01 Aug 2025 06:40:50 GMT; Path=/; HttpOnly". Invalid 'expires' attribute: Fri, 01 Aug 2025 06:40:50 GMT

liferay        | 2024-08-01 06:40:50.250 WARN  [http-nio-8080-exec-4][ResponseProcessCookies:130] Invalid cookie header: "Set-Cookie: COOKIE_SUPPORT=true; Max-Age=31536000; Expires=Fri, 01 Aug 2025 06:40:50 GMT; Path=/; HttpOnly". Invalid 'expires' attribute: Fri, 01 Aug 2025 06:40:50 GMT

liferay        | 2024-08-01 06:40:50.460 WARN  [liferay/adaptive_media_processor-4][AMMessageListener:79] Unable to scale file entry 59679 to match adaptive media configuration Preview-1000x0

liferay        | com.liferay.adaptive.media.exception.AMRuntimeException$IOException: Unable to scale file entry 59679 to match adaptive media configuration Preview-1000x0

liferay        |        at com.liferay.adaptive.media.image.internal.scaler.AMDefaultImageScaler.scaleImage(AMDefaultImageScaler.java:60) ~[?:?]

liferay        |        at com.liferay.adaptive.media.image.internal.processor.AMImageAMProcessor.process(AMImageAMProcessor.java:105) ~[?:?]

liferay        |        at com.liferay.adaptive.media.image.internal.processor.AMImageAMProcessor.process(AMImageAMProcessor.java:63) ~[?:?]

liferay        |        at com.liferay.adaptive.media.image.internal.processor.AMImageAMProcessor.process(AMImageAMProcessor.java:35) ~[?:?]

liferay        |        at com.liferay.adaptive.media.web.internal.messaging.AMProcessorCommand$2.execute(AMProcessorCommand.java:34) ~[bundleFile:?]

liferay        |        at com.liferay.adaptive.media.web.internal.messaging.AMMessageListener.doReceive(AMMessageListener.java:70) [bundleFile:?]

liferay        |        at com.liferay.portal.kernel.messaging.BaseMessageListener.doReceive(BaseMessageListener.java:39) [portal-kernel.jar:?]

liferay        |        at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:25) [portal-kernel.jar:?]

liferay        |        at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:62) [portal-kernel.jar:?]

liferay        |        at com.liferay.portal.messaging.internal.ParallelDestination$1.run(ParallelDestination.java:47) [bundleFile:?]

liferay        |        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_412]

liferay        |        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_412]

liferay        |        at java.lang.Thread.run(Thread.java:750) [?:1.8.0_412]

liferay        | Caused by: com.liferay.adaptive.media.exception.AMRuntimeException$IOException: java.io.IOException: Unsupported image type

liferay        |        at com.liferay.adaptive.media.image.internal.processor.util.TiffOrientationTransformer.transform(TiffOrientationTransformer.java:46) ~[?:?]

liferay        |        at com.liferay.adaptive.media.image.internal.scaler.AMDefaultImageScaler.scaleImage(AMDefaultImageScaler.java:40) ~[?:?]

liferay        |        ... 12 more

liferay        | Caused by: java.io.IOException: Unsupported image type

liferay        |        at com.liferay.adaptive.media.image.internal.util.RenderedImageUtil.readImage(RenderedImageUtil.java:105) ~[?:?]

liferay        |        at com.liferay.adaptive.media.image.internal.processor.util.TiffOrientationTransformer.transform(TiffOrientationTransformer.java:43) ~[?:?]

liferay        |        at com.liferay.adaptive.media.image.internal.scaler.AMDefaultImageScaler.scaleImage(AMDefaultImageScaler.java:40) ~[?:?]

liferay        |        ... 12 more

The metadata of both files (the one loaded manually and the one loaded via the API are identical). I am using verion 7.4.3.GA120 (CE)

I am grateful for any advice.

Regards
Markus 

Community
Company
Feedback