jprichardson / node-fs-extra

Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
MIT License
9.44k stars 776 forks source link

Image copy is broken #946

Closed vladtopchu closed 2 years ago

vladtopchu commented 2 years ago

Tried to copy directory with all it's files (code + various types of images (png, jpg, jpeg, webp)), but when I'm trying to open an image - it appears to be broken.

I used this function: fse.copySync(from, destination)

Code files copying just fine, without any loses

RyanZim commented 2 years ago

it appears to be broken.

How is it broken?

vladtopchu commented 2 years ago

How is it broken?

It's not opening in any way. Few examples: 1) Windows Image Viewer and Photoshop showing "unsupported type" error even tho file extension are the same 2) Browser showing a tiny little white square

vladtopchu commented 2 years ago

I'm sorry, it was my fault. The thing is - I was trying to copy a folder, that contains images and then I'd go trough every file in folder and replace some words in them. The problem was that I was reading every file without any extension filters (to prevent image reading). So I was reading images with utf-8 setting, then performed some manipulations and then rewrite them... I'm dummy, sorry!