Steemit and Utopian have a great feature — pasting images from the clipboard. If you want to make a screenshot and upload it then you do not need using any software to edit images — you can just press your hotkeys to make screenshots, select an area, and just press Ctrl+V in the form, then your screenshot should be automatically uploaded to the website.
This feature is great working on Steemit, it also is great working on Utopian on the page of creating a new post.
The problem is that on Utopian it is not working in the comments. Just nothing happens.
I went deeper and started to check a console output.
I was thinking that the text above is the full bug report but then I started checking the code and discovered that any uploading of images in comments does not work (with the exception of the upload from urls).
In both cases, the error was raised by isValidImage function. But Utopian has various methods for uploading from the clipboard and for uploading from local files. In the first case, the error was raised by this string, in the second by this.
Device information
OS: Ubuntu 14.04
Browser: Google Chrome 62.0.3202.94 (64-bit)
How to reproduce
- Go to the comment section.
- Try to upload an image in the comment form from your local files or clipboard.
How to fix
I checked this isValidImage function. And it seems that this is legacy code that still is not removed. CommentForm.js imports this function (and MAXIMUM_UPLOAD_SIZE) from helpers/image.js but this file has only the getProxyImageURL function. Moreover, its last string is export default null;. It seems someone just forget about this file. The method for uploading images on the page of creating a new post is correct and developers can just move its code to the CommentForm.js.
Posted on Utopian.io - Rewarding Open Source Contributors