-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
co-608: image fix #317
base: release-6.0.1
Are you sure you want to change the base?
co-608: image fix #317
Conversation
@@ -551,6 +551,8 @@ function imageData(image) { | |||
return (bufferImage = image.replace("data:image/jpg;base64,", "")); | |||
} else if (image.includes("data:image/jpeg;base64")) { | |||
return (bufferImage = image.replace("data:image/jpeg;base64,", "")); | |||
} else if (image.includes("data:application/octet-stream;base64")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manojSRawat The application/octet-stream type is shown for documents when mimetype is unknown ( I have seen this when I have opened file in spreadsheets and word docs) ? (Correct me if I am wrong). So considering it as an image will be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also face this kind of issue while uploading files on s3 without setting content-type.
@vaivk369 @vinukumar-vs could you please check if there is any change in upload functionality that might be related to this issue?
@@ -471,7 +471,7 @@ function createSAObject(data, count) { | |||
children: arr, | |||
}); | |||
} else if (data.image) { | |||
if (data.image.includes("data:image/")) { | |||
if (data.image.includes("data:")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it was added & now why it is removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data:image is the actual way of finding the image or not. Why it is removed now. How are you identifying the data is image or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add a check based on file extension but agian that's not a correct way because user can modify the file extension and upload it.
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Type of change
Please choose appropriate options.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes in the below checkboxes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: