Adding photos using Tidypics

Hi all

I am a new ELGG Administrator, setting up a TEST site for use in our organisation. I am trying to upload a pic in a Group. I created a Photo Album and I want to upload a pic to this album. I am testing in Chrom and in IE11. We use Windows 8 in our world.  The ELGG install is on XAMPP on Win 2012R2.

In Chrome:

The upload fails with this msg: Unexpected error while performing AJAX call. Maybe connection to the server was lost.

In IE 11: 

The Upload control does not even show up. 

I am sure others have has this issue as well. How did you get it resolved?

I appreciate any help with this.

Len

 

  • Check your error logs, an Ajax error would have left a trace.

  • I've already replied to your first posting on the Tidypics plugin page asking you which version of Tidypics you are using and to make sure you have the recommended (and newest) version of Tidypics for the version of Elgg in use installed.

    As you seem to also have trouble with CKeditor the error on image uploads might not even caused by Tidypics itself though. Another likely reason could be that you have another 3rd party plugin installed that is buggy or simply not compatible with the Elgg version in use. Such a problematic plugin could cause problem for other plugins. I suggest to disable all 3rd party plugins temporarily and then test if you still have issues with CKeditor. Then enable Tidypics to see if the problem still occurs. If you don't have the problems anymore, you know that one (or maybe more than one) of the other plugins installed is causing the trouble. With some guesswork you might be able to identify the problematic plugin (e.g. if the plugin developer hasn't recommended it for the Elgg version you use). Otherwise, you would need to enable the 3rd party plugins one at a time to see which is causing the trouble.

  • Thank you for your reply.

    We are using (testing) ELGG2.2.3 at the moment.

    I am still extremely new at this and am getting my head around the idea of using the Plugins correctly by placing them in the correct order. How do we know which Plugins are 3rd party plugins? We use Tidypics v2.0.2 For those more experienced ordering plugins, which would you recommend we avoid?

    Here is our Plugins as they stand currently and I am (almost embarrassed) not sure if the order is correct:

    1. Bookmarks
    2. Blog
    3. File
    4. Garbage Collector
    5. Groups
    6. HTMLawed
    7. Invite Friends
    8. Log Browser
    9. Log Rotate
    10. Data View for Web Services
    11. Tidypics Photo Gallery
    12. Login As
    13. Database Cleaner
    14. News Plugin
    15. Group Tools
    16. Poll
    17. Notifications
    18. Profile
    19. Tidypics Plus
    20. Profile Manager
    21. Widget Manager
    22. Site Notifications
    23. The Wire
    24. User Validation by Email
    25. User Dashboard
    26. Diagnostics
    27. Discussions
    28. Discussions Tools
    29. Likes
    30. CKEditor
    31. Aalborg Theme

     

     

     

  • I also see the Max Limit filesize per image is set to 5Mb. I reduced the filesize to 1.9Mb and it still rejects the image (according to the error Log....)

  • I also see the Max Limit filesize per image is set to 5Mb. I reduced the filesize to 1.9Mb and it still rejects the image (according to the error Log....)

     

    I have also increased the max file size in htaccess to 10Mb, but still get the error in the log that the file size exceeds the max quota.

    Here is the Procedure in the PHP Class.

    // make sure file does not exceed memory limit
            if (!tp_upload_check_max_size($data['size'])) {
                throw new Exception(elgg_echo('tidypics:image_mem'));
            }

            // make sure the in memory image size does not exceed memory available
            $imginfo = getimagesize($data['tmp_name']);
            $requiredMemory1 = ceil($imginfo[0] * $imginfo[1] * 5.35);
            $requiredMemory2 = ceil($imginfo[0] * $imginfo[1] * ($imginfo['bits'] / 8) * $imginfo['channels'] * 2.5);
            $requiredMemory = (int)max($requiredMemory1, $requiredMemory2);
            $image_lib = elgg_get_plugin_setting('image_lib', 'tidypics');
            if (!tp_upload_memory_check($image_lib, $requiredMemory)) {
                trigger_error('Tidypics warning: image memory size too large for resizing so rejecting', E_USER_WARNING);
                throw new Exception(elgg_echo('tidypics:image_pixels'));
            }

            // make sure file fits quota
            if (!tp_upload_check_quota($data['size'], elgg_get_logged_in_user_guid())) {
                throw new Exception(elgg_echo('tidypics:cannot_upload_exceeds_quota'));
            }
        }

     

    Is the file size static or is it set elsewhere in PHP as well?

  • @iionly, you may want to remove size checks from the next iteration of tidypics. Let the server deal with these issues.

  • 3rd party plugins in this list are

        Tidypics Photo Gallery
        Database Cleaner
        News Plugin
        Group Tools
        Poll
        Tidypics Plus
        Profile Manager
        Widget Manager
        Discussions Tools

    On the top of the plugin page are also some filters available, e.g. "bundled" plugins or "non-bundled" (= 3rd party plugins). This way you can see better which 3rd party plugins are installed. If I'm not mistaken the "Activate all" / "Disable all" plugins buttons are not limited to the filtered plugins but always target all available plugins even if currently not shown due to a filter. Therefore, you would have to activate / deactivate the 3rd party plugins one at time if necessary for testing.

    Plugin order shouldn't be relevant. Plugins can also tell if a certain order (e.g. "after plugin x") is necessary. If such a restriction isn't fullfilled, the plugin can't be enabled due to such a requirement not fullfilled. A click on a plugin title in the list also opens a popup where the requirements of a plugin are listed. Strictly speaking, a plugin might not tell you about all its requirements if the plugin developer hasn't defined them in the manifest.xml of a plugin. But the most used plugins have the requirements defined correctly. And also a certain plugin order is not defined by many plugins anyway.

    I would suggest to place the bundled plugins above the 3rd party plugins. Tidypics Plus below Tidypics (that's the only requirements with regards of plugin order I see with the 3rd party plugins).

    My suggestion:

    • first test your site with ALL 3rd party plugins disabled with regards to your CKeditor issue. If the problem with CKeditor remains even with all 3rd party plugins disabled, there is some issue that might also cause Tidypics not to work correctly and trying to get Tidypics to work by looking for the error in Tidypics might be pointless then.
    • then try Tidypics with all other 3rd party plugins (also Tidypics plus) disabled. While you have listed the plugins you have installed I don't see which version of these plugins you have installed and maybe one of the plugins is not compatible with Elgg 2 (even if the plugin says otherwise as there might just be some bug undiscovered yet).

    Upload limits:

    • the value set for upload_max_filesize in htaccess is the maximum filesize any uploaded file (not only for Tidypics but also for any other upload to the Elgg site) is never allowed to exceed. The upload limit you can set on the Tidypics settings page is only for image uploaded with Tidypics. (@ihayredinov this infor also for you) The separate limit for images in Tidypics allows you to set a high limit for other type of uploads (e.g. video files) but you can still restrict the maximum size for images, e.g. not wanting someone to upload huge animated gifs. Therefore the usage of the server limits is not enough here (and another reason is that image resizing when creating the thumbnails requires a large amount of memory when using the GD php extension as image library - for very large images easily more than available on the server - for other type of uploads this won't happen and therefore is makes sense to also be able to limit the image filesize separately for this reason alone. The code you have listed is the code to check for possible higher memory requirements than memory is available and to reject images when the memory for creation the thumbnails is not enough). My suggestion: set upload_max_filesize to a larger value than the limit set in Tidypics. 2MB is mostly fine for Tidypics but set for example 5MB in htaccess (in htaccess the correct syntax would be 5M and not 5MB).
    • post_max_size in htaccess: very important, too. It must be at least as large as upload_max_filesize. If more than a single image can be uploaded at a time the value of post_max_size must be at least upload_max_filesize x number of images plus some overhead, e.g. with upload_max_filesize 5MB and 10 images at maximum set post_max_size to at least 50MB (in htaccess 50M).
    • memory_limit in htaccess: as already mentioned above the memory requirements for creation of thumbnails with the GD php extension (default image library in Tidypics) can be huge. Maybe your problem isn't even the filesize limit but the memory_limit. 64MB is the likely lower limit. Better would be 128MB (syntax in htacess 128M). Alternatively, select another image library in the Tidypics settings if you have the Imagick php extension or the Image Magick package installed on your server. Both of these alternatives have much lower memory requirements and they will also give better results in image quality of the thumbnails (I prefer the Image Magick command line tools).

    Also check the info on the "Server Information" tab of the Tidypics settings page. Are the values shown there for the limits the same as set in htaccess? If not, your server config might not allow setting php config variables in htaccess files.

    Try it with uploading a single small image for the start. An image surely much smaller than the filesize limits defined to make sure that the problem is surely not the filesize. If the html uploader still fails to work, disable this uploader in the Tidypics settings and use the basic uploader instead. The basic uploader is rock-solid and there shouldn't be any browser issues with it. If the basic  uploader works but the html5 uploader does not, the problem would be indeed in Tidypics with the html5 uploader.

  • Hi iionly

    Many thanks for your guidance. I will start testing by removing these 3rd pty plugins and see how it pans out.

    Your help much appreciated.

    Len

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking