Gabriel Sobrinho
Gabriel Sobrinho
Until a native solution is implemented, you can download the image and use imagemagick's auto-orient before embedding into the PDF.
`convert -auto-orient -strip original.jpg transformed.jpg` Then you can use the `transformed.jpg` in the script, no need to ask the customer! ;)
Oh, I see, I thought you were in back-end mode. Alright, let me try to find something for you in the front-end side.
Didn't try but can you check if a package like this would do the job for you? https://github.com/onurzorluer/exif-auto-rotate
Oh even that one: https://jsfiddle.net/orotemo/obvna6qn/1/ You don't even need a 3rd package, apparently.
That's a reference for reading the image, you can use it to detect the rotation and then use the canvas API to rotate it. I'm not giving you the copy/paste...
How did you try? If you can read the image EXIF, get the rotation nad then use the canvas API to render the image, rotate it and convert it back...
It's not possible due to the Heroku limitations about how long the process have to terminate before being killed. You could do a TSTP signal and wait until the running...
``` closure.c:263:14: error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-function-declaration] result = ffi_prep_closure(pcl, cif, callback, (void *)self); ^ 1 error generated. make[2]: *** [closure.o] Error 1 make[1]:...
Fixed with: ```bash export RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC export LDFLAGS="-L/opt/homebrew/opt/libffi/lib" export CPPFLAGS="-I/opt/homebrew/opt/libffi/include" export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig" ```