hotfix: upload image from file (revert encode bytes to base64)

This commit is contained in:
MedzikUser 2022-04-05 17:03:57 +02:00
parent 8cd1a31b72
commit 1048ea298f
No known key found for this signature in database
GPG Key ID: A5FAC1E185C112DB
1 changed files with 5 additions and 1 deletions

View File

@ -34,9 +34,13 @@ impl ImgurClient {
// check if the specified file exists if not then check if it is a url
if Path::new(&path).exists() {
image = fs::read_to_string(&path)
let bytes = fs::read(&path)
.map_err(|err| err.to_string())
.expect("read file");
image = base64::encode(bytes)
// validate adress url
} else if !validator::validate_url(&path) {
let err = io::Error::new(
io::ErrorKind::Other,