Profile Image Crop by FriendsOfFlarum

License Latest Stable Version Downloads

Extiverse

Allow cropping when uploading a profile picture. Original by @WiseClock.

screenshot

Installation

Use Bazaar or install manually with composer:

composer require fof/profile-image-crop:"*"

Updating

composer update fof/profile-image-crop

Links

OpenCollective GitHub

An extension by FriendsOfFlarum.

    6 months later

    Thank u so much 👍

    3 months later

    Unable to upload image from mobile device. It shows blank. Working on desktop

      2 months later
      4 months later
      20 days later
      6 months later

      0.2.0

      • beta 14 ready 🥳
      Updating
      composer require fof/profile-image-crop:^0.2.0
      php flarum cache:clear
        a month later

        0.2.1

        • Updated meta ready for beta 15 (no code/functionality change)
        • Compatible with beta 14 and up
        Updating
        composer require fof/profile-image-crop:^0.2.1
        a month later

        How to Increase the Image File Size Limit?

        Hi there, I think the image cropping extension is great, however it seems to impose additional restrictions on the image file size. Suppose I have this image and would like to use it as an avatar,

        pexels-paul-voie-2627945.jpg

        with fof/profile-image-crop disabled, it could be uploaded without a problem. However, when this extension is enabled, uploading the image results in an error raised from the actual page, as well as a 413 response at the console,

        <html>
        <head><title>413 Request Entity Too Large</title></head>
        <body bgcolor="white">
        <center><h1>413 Request Entity Too Large</h1></center>
        <hr><center>nginx/1.14.0 (Ubuntu)</center>
        </body>
        </html>

        So one can conjecture that there's an extra limit imposed by this extension. @datitisev

          qxzh That's an error on the nginx level, you'll need to adjust your web server config if you want to change that.

            askvortsov Thanks for your quick reply. I add the following content to /etc/nginx/nginx.conf,

            http {
                client_max_body_size 8M;
            
                //other lines...
            }

            and then reload

            sudo systemctl reload nginx.service

            the error turned to 422 Unprocessable Entity with the following content:

            POST https://bbs.viva-la-vita.org/api/users/1/avatar
            
            avatar 不能为空

            where 不能为空 means "cannot be null". What should I do then?

              mekici Thank you for pointing this source code out and this seems indeed the key to solve my problem. I modified this in /vendor/flarum/core/, and what "reload" steps do I need to get this work? I did systemctl reload nginx and systemctl reload php7.2-fpm, but it still doesn't work.

              2 months later

              0.3.0

              • Beta 16 support
              Updating
              composer require fof/profile-image-crop:"*"
              php flarum cache:clear