Studio-42 / elFinder

📁 Open-source file manager for web, written in JavaScript using jQuery and jQuery UI
https://studio-42.github.io/elFinder/
Other
4.65k stars 1.42k forks source link

Can't rotate image. Ver 2.1.11 #1380

Closed bbfriend closed 8 years ago

bbfriend commented 8 years ago

I can't rotate image.

Ver 2.1.11

http://...../elfinder/elfinder.html , all defaut Setting.(Nothing has been set) upload image ・・ OK resize ,crop , rename ・・ OK

But can't rotate. example ,rote_tab -> rotate 90 -> Click Apply I get message to Error Unable to connect to backend "Invalid backend response. Data is not JSON."

What do configuration and operating conditions I need? Github Demo http://studio-42.github.io/elFinder/ is rotate OK.

~~*addition) now I checked by Firebug. "NetworkError: 500 Internal Server Error - http://..../elfinder/php/connector.minimal.php?cmd=resize&target=l1_MTIyLmpwZw&width=228&height=328&degree=90&quality=100&mode=rotate&_=1462804481335~~

nao-pon commented 8 years ago

@bbfriend Have you more infomation about php errors from server log?

ghost commented 8 years ago

@nao-pon on this subject, what PHP libraries need to be installed to allow image resizing, rotating, and so on with the editing options?

nao-pon commented 8 years ago

@bbfriend I fixed notice error in rotate function @b98d582b785fb4211e6f0b1a79025dda37adcebc.But it was Notice error, It may not be the cause of this problem

nao-pon commented 8 years ago

@StudioJunkyard elFinder use php imagick extention, GD, or server command convert(imagimagick). And rotate function use server command exiftran or jpegtran if it is possible.

ghost commented 8 years ago

Ah ok, I've stayed away from imagick as there's currently an open security issue with it (might be patched now), that was posted about in /r/netsec in Reddit. I've got GD2 installed on the live server, but the edit, for resize and rotate isn't working according to client reports, I haven't had time to test it myself. Is there something that needs to be enabled in the connector settings, or elsewhere?

ghost commented 8 years ago

https://blog.cloudflare.com/inside-imagetragick-the-real-payloads-being-used-to-hack-websites-2/

nao-pon commented 8 years ago

@StudioJunkyard Use GD(2) to image libs with connector root config 'imgLib' => 'gd'.

ghost commented 8 years ago

Thanks @nao-pon, much appreciated. Client's have been loving using your project in my CMS, it's made things so much easier. Using it as an addon for Summernote WYSIWYG editor, and as a Media Manager embedded in a page.

bbfriend commented 8 years ago

@nao-pon 私は、日本人です。 Error message was different. エラーを間違ってました。 ”Invalid backend response. Data is not JSON.”  and Firebug does not have an error.

*Apache/2.2.15 CentOS 6.2 libjpeg-turbo.x86_64 1.2.1-3.el6_5 php-gd.x86_64 5.3.3-46.el6_7.1

bbfriend commented 8 years ago

And ,Strange phenomenon? elfinder.html changes in PHP execution form.

Apache Module apache_module

Apache CGI ,FastCGI cgi

bbfriend commented 8 years ago

Oh! Find! elFinderVolumeDriver.class.php About line4495 Line4460

protected function imgRotate($path, $degree, $bgcolor = '#ffffff', $destformat = null, $jpgQuality = null) {  
    debug($path, $degree);  
    if (($s = @getimagesize($path)) == false || $degree % 360 === 0) {

to

protected function imgRotate($path, $degree, $bgcolor = '#ffffff', $destformat = null, $jpgQuality = null) {  
//    debug($path, $degree); 
    if (($s = @getimagesize($path)) == false || $degree % 360 === 0) {

Comment out debug($path, $degree);

”rotate image” work fine! Thanks for the tip.@nao-pon

ghost commented 8 years ago

For me it was at line 4460.

ghost commented 8 years ago

Actually, for me the radio buttons are disabled.

bbfriend commented 8 years ago

Hi! @StudioJunkyard. you're right. Line 4460.

nao-pon commented 8 years ago

@bbfriend @StudioJunkyard This bug was already fixed in master branch. Please check with nightly build.

Thanks!

ghost commented 8 years ago

Cheers @nao-pon keep up the great work.

ghost commented 8 years ago

I just update everything, even cleared my browser cache to be sure the updated code is being used. I can resize image, but the crop and rotate radio buttons are still disabled. Is there maybe some setting I need to enabled, or apache/PHP library that needs to be installed?

ghost commented 8 years ago

Actually, I just noticed all three radio buttons are disabled. But the resize still works.

ghost commented 8 years ago

I should check things a bit more closely. When I actually go to perform the resize on an image, I get back a dialog with an error: Invalid parameters for command "resize".

bbfriend commented 8 years ago

@nao-pon

This bug was already fixed in master branch. Please check with nightly build.

I'm going to publish as a plugin CMSimple,stable(regular) version is required. ありがとう。

nao-pon commented 8 years ago

@StudioJunkyard Perhaps ... It seems there are problems in the JavaScript or theme side. Please create a new issue, if necessary.

nao-pon commented 8 years ago

@bbfriend OK. 2.1.12 coming soon.

ghost commented 8 years ago

@nao-pon, currently client's just upload a thumbnail image they wish to use, as I use elF in three ways. As a plugin to Summernote for media management, as a file uploader and selector within an input field for main and thumbnail images for products, blog cover images, and as a stand alone media manager on it's own page. It would be handy to for client's to edit a single upload image by duplicating it, renaming it, and cropping or rotating to use a thumbnail.