ckchaudhary / bp-force-avatar-upload

Force users to upload their avatar - a buddypress plugin
0 stars 0 forks source link

Crop bug with small images #1

Open omtr opened 9 years ago

omtr commented 9 years ago

in some cases the cropping result is wrong. for example, if you want to crop one face from a group picture, the result shows only one quarter of the face, not the whole face. below is a result of a miscropped face: crop i'm still trying to reproduce in what cases the cropping goes wrong. at first glance, it seems that cropping works better when you use large images.

ckchaudhary commented 9 years ago

Hi omtr. I'll check on my end and try to reproduce the error. Let me know if you found the exact problem. Thanks.

omtr commented 9 years ago

Hi Chandan,

will do this evening. I will make a test series of different scaled images and see what happens. i will send you my report asap!

best regards omtr

Am 28.04.2015 08:39, schrieb Chandan Chaudhary:

Hi omtr. I'll check on my end and try to reproduce the error. Let me know if you found the exact problem. Thanks.

— Reply to this email directly or view it on GitHub https://github.com/ckchaudhary/bp-force-avatar-upload/issues/1#issuecomment-96946742.

omtr commented 9 years ago

Hi Chandan,

i tested this evening, actually all images are cropped wrong. i changed the hidden fields in bf-force-avatar-upload.php to type=text to see if the jquery crop coordinates are set correctly.

                 <input type="text" id="x" name="x" />
                 <input type="text" id="y" name="y" />
                 <input type="text" id="w" name="w" />
                 <input type="text" id="h" name="h" />

it seems that on this side the coordinates are set properly. but when i opened the avatar that is displayed in the modal form in another tab i realized that it is scaled by css. so the coordinates are set correctly if the image is scaled by css, but the do not fit to the original image (which is most likely larger than the scaled image).

so that's the reason why the cropping rectangle does not fit to the resulting image.

at this point, i am actually not sure if the problem resides in your code or maybe i spoiled something deep inside my stylesheets.

i guess i will test this in another buddypress instance with a fresh plugin install, hence i can check if the problem occurs straight from the plugin installation.

i will keep you updated!

Thanks for your help and best regards from Germany! timo

Am 28.04.2015 um 08:39 schrieb Chandan Chaudhary:

Hi omtr. I'll check on my end and try to reproduce the error. Let me know if you found the exact problem. Thanks.

— Reply to this email directly or view it on GitHub https://github.com/ckchaudhary/bp-force-avatar-upload/issues/1#issuecomment-96946742.


Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft. http://www.avast.com