image extension v2 fails silently errors writing out unsupported image formats
Description
Environment
Activity
Pothys - MitrahSoft 13 December 2022 at 11:48
I've checked this ticket with the lucee image extension latest version 2.0.0.20-BETA. now image extension v2 throws an error with unsupported image formats
Zac Spitzer 12 December 2022 at 16:19
Jamie Jackson 6 December 2022 at 15:18Edited
@Michael Offner , here’s a simple use case where it fails silently, instead of writing a file.
<cfscript>
img = imageReadBase64('data:image/webp;base64,UklGRoIDAABXRUJQVlA4WAoAAAAMAAAAAQAAAQAAVlA4ICIAAABQAQCdASoCAAIAAgA0JQBOgCgAAP7o1xGE0jAYElaswgAARVhJRmgAAABNTQAqAAAACAAEAQYAAwAAAAEAAgAAARIAAwAAAAEAAQAAASgAAwAAAAEAAQAAh2kABAAAAAEAAAA+AAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAAACoAMABAAAAAEAAAACAAAAAFhNUCDKAgAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iPgogICAgICAgICA8dGlmZjpDb21wcmVzc2lvbj4xPC90aWZmOkNvbXByZXNzaW9uPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpQaG90b21ldHJpY0ludGVycHJldGF0aW9uPjI8L3RpZmY6UGhvdG9tZXRyaWNJbnRlcnByZXRhdGlvbj4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjI8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpDb2xvclNwYWNlPjE8L2V4aWY6Q29sb3JTcGFjZT4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjI8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4Kq');
filepath = "./1x1px.webp"
img.write(filepath);
dump(var = fileexists(filepath), label = "fileexists");
dump(var = isImageFile(filepath), label = "isImageFile");
</cfscript>
Image Extension Version 2.0.0.18-BETA
Response (no exception):
fileexists: boolean false
isImageFile: boolean false
Logs are as follows (all of these entries are just for the single request). I assume this is due to the re-tries with different codecs, but the file is never written in this case.
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:38","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:38","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:38","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:38","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:38","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:38","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:38","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:38","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:38","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:38","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:39","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:39","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:39","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:39","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:39","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:39","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:39","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:39","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:39","image","use JDeli Image En/Decoder"
"INFO","http-nio-8888-exec-8","12/01/2022","18:00:39","image","use JDeli Image En/Decoder"
Michael Offner 6 December 2022 at 09:34
i’m not exactly sure if that conclusion is correct.
the imae extension comes with multiple coder (encoder/decoder) and it goes to them when trying to write an image (encode). if encoder 1 fails it will try encoder 2 and so one. the goal is to get ONE encoder doing the work, if the last does the job all is good.
So i assume what you see is encoder failing, what is expected and fine as long one can do the job in the end.
Pothys - MitrahSoft 5 December 2022 at 08:26
I've checked this ticket and confirmed the issue happened on the lucee version 5.3.10.98-SNAPSHOT and Image extension version 2.0.0.18-BETA. When using the imageWrite() with unsupported image formats, it didn't throw an error and it fails silently.
Details
Assignee
Pothys - MitrahSoftPothys - MitrahSoftReporter
Zac SpitzerZac SpitzerPriority
NewLabels
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Details
Details
Assignee
Reporter
Priority
Labels
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
https://github.com/lucee/extension-image/blob/master/source/java/src/org/lucee/extension/image/ImageUtil.java#L120