Closed cserb closed 6 years ago
paperclip-compression uses it's own optipng which is included in the bin folder. What is your FreeBSD and ruby version?
@emrekutlu ruby is 2.1.2 and FreeBSD is 10.1
@cserb I released a new version; 0.3.7. Can you try that please?
@emrekutlu I tried with the new version. I get this now:
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/d02ebba086eb60b6155b94e12649ff8420150318-75717-18uk6vd.jpg[0]' 2>/dev/null
Command :: identify -format %m '/tmp/d02ebba086eb60b6155b94e12649ff8420150318-75717-18uk6vd.jpg[0]'
Command :: convert '/tmp/d02ebba086eb60b6155b94e12649ff8420150318-75717-18uk6vd.jpg[0]' -auto-orient -resize "40x40>" '/tmp/d02ebba086eb60b6155b94e12649ff8420150318-75717-18uk6vd20150318-75717-upjwda'
Command :: /home/mars/.rvm/gems/ruby-2.1.2@sdj/gems/paperclip-compression-0.3.7/bin/linux/x64/jpegtran -copy none -optimize -perfect '/tmp/d02ebba086eb60b6155b94e12649ff8420150318-75717-18uk6vd20150318-75717-upjwda' > '/tmp/d02ebba086eb60b6155b94e12649ff8420150318-75717-18uk6vd20150318-75717-upjwda20150318-75717-1c26e2g'
[paperclip] An error was received while processing: #<Paperclip::Error: JPEGTRAN : There was an error processing the thumbnail for d02ebba086eb60b6155b94e12649ff8420150318-75717-18uk6vd20150318-75717-upjwda>
This is obviously a problem of the binary not working on FreeBSD. I went to ../.rvm/gems/ruby-2.1.2@sdj/gems/paperclip-compression-0.3.7/bin/linux/x64/jpegtran
and created a symlink to the system jpegtran. It works without a problem.
As a quick solution, wouldn't it be better to use the jpegtran and optipng available on the machine IF FreeBSD is detected, or to be able to provide the path in the config?
Did you get any solution for this? I am facing the same problem with png images.
@sonali1908 as I mentioned in the post before, I went to the folder of the paperclip-compression gem and created a symlink to the binaries installed via freebsd ports this is obviously very dirty, but I didn't update any relevant dependencies yet so it still works for me. A cleaner solution would be to fork the gem and apply a different rule for freebsd.
command
option added with the release of 1.0.0
. You can get rid of that symlinks and use that option. Refer to readme for more information. No backward incompatible changes.
I have this error on the production server (FreeBSD) while locally everything works. So I thought that the compression might not work due to optipng but running it manually on a png file
optipng -o 5 file.png
on the server works perfectly fine