next-image-export-optimizer
next-image-export-optimizer copied to clipboard
Filenames too long with long urls
Hi, when remote urls are very long (for example when using Instagram images) the filename gets too long (over 256 chars) and the optimization fails with Error: ENAMETOOLONG: name too long
. I suggest using an sha1 of the URL to encode the filename.
Hi @ibobo, Thanks for the suggestion. The problem is that there is no good hashing algorithm available in the client environment. The browser crypto option is only available for https connections. Do you have a suggestion that doesn't blow up the package size?
@Niels-IO Have you considered jsSHA? It allows loading individual algorithms to keep the bundle size low.
I used a hash function which I found on Stack Overflow in v1.14.0. This should get rid of the problem with long urls. Could you please confirm?