Forums

[Scissors Plugin] Options not appearing on older images (8 posts)

  1. miruru
    Member
    Posted 4 months ago #

    Hi, I just want to say that this is a great plugin and it has worked perfectly. I have one small problem though. Any images that I have uploaded this year (2009), I have the options to crop/rotate/resize/watermarks. However, when editing some of my images which were uploaded in 2008, i do not have these options.

    I do not want to re-upload all the images as there is a lot. Is there any reason why the options does not appear. Anything I could do to get them back up?

  2. stephanreiter
    Member
    Posted 4 months ago #

    I've had another user report a similar problem but I still haven't been able to figure this out. Could you take a look at the function scissors_media_meta in scissors.php and determine which of the checks in the head of the function pass and which (if any) fail, e.g. if the file exists? You could also try commenting them out after which the controls should appear on every image ...

  3. miruru
    Member
    Posted 4 months ago #

    I've tried commenting out the following:

    $postId = $post->ID;
                    $filename = get_attached_file($postId);
    		if(!$filename || !file_exists($filename))
                    return $string;
    
    		list($width, $height) = getimagesize($filename);
                    if($width <= 0 || $height <= 0)
    			return $string;

    but it has made no difference. I get the controls but when i click on the controls, nothing happens. I do get the Division by zero error on line 855. I've even commented out line 855 but still the controls does not do anything.

    Is there anything else I need to comment out? I'm not even sure how i should check whether the function pass or fail.
    Thanks again for your help.

  4. stephanreiter
    Member
    Posted 4 months ago #

    Only comment out those if-blocks (e.g. if(...) return ...;), the other lines in between are still required.

  5. stephanreiter
    Member
    Posted 4 months ago #

    Please note that commenting out anything is not suddenly going to fix this. What we're trying to do here is to figure out which of the conditions is not satisfied. Therefore, please tell me what minimal set of ifs needs to be commented out for the controls to appear. Thanks!

  6. miruru
    Member
    Posted 4 months ago #

    ok, i'm getting one step closer to the controls actually working.

    I have commented out:

    if(!$filename || !file_exists($filename))
    return $string;

    and

    if($width <= 0 || $height <= 0)
    return $string;

    then i got the following error:

    Warning: getimagesize(url) [function.getimagesize]: failed to open stream: No such file or directory in myurl/plugins/scissors/scissors.php on line 805
    
    Warning: Division by zero in myurl/plugins/scissors/scissors.php on line 876

    I commented out line 805 which is:

    list($width, $height) = getimagesize($filename);

    This removed the first warning message and left me with the Division by Zero message on line 876. To remove the Division by Zero message, I commented out:

    $string .= "<input type='hidden' id='scissorsFullAspectRatio-$postId' value='" . ($width / $height) . "' />";

    and it has removed all warning messages and the controls actually appeared.

    I was able to click on the controls and when selecting "Apply", I get the progress bar as though it is actually doing something but then I get an error message saying, "Invalid post-id"

    I hope the above helps with diagnosing this problem.

    Thank you for all your help so far.

  7. stephanreiter
    Member
    Posted 4 months ago #

    The problem is that the path ($filename) returned by get_attached_file doesn't point to the image. Check the forum if there are any known bugs. Maybe you can also spot a difference between said $filename and the actual path on the server, which might give us a clue as to what is going wrong here.

    Thanks!

  8. miruru
    Member
    Posted 4 months ago #

    hmmm, thank you for all your help.

    I couldn't find anything in the forum. In the end, I've decided to re-upload those images that did not have the controls as it would be quicker than to work out what is wrong.

Reply

You must log in to post.

About this Topic