rayantony / jcrop

Automatically exported from code.google.com/p/jcrop
0 stars 0 forks source link

JCrop select box shows full image instead of selection in Android #96

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am trying to build a phonegap app in Android.
I take a photo in one page and pass it to another where the cropping is to take 
place.

The selected area is not blank but contains a scaled down version of the image 
to be cropped.

It appears that when I crop the image the resultant image is actually a cropped 
version of the original image, but I would like the cropping select box to 
behave properly and show the part of the image behind it that it is covering.

I am using the latest version of jcrop - jquery.Jcrop.min.js v0.9.12 
(build:20130202).

I am using a Samsung Galaxy Note II N7100 with the Android 4.1.2 operating 
system for testing.

I have not changed the browser, so it is the default one. If I 
alert(navigator.userAgent), the result is Mozilla/5.0(Linux; U; Android 4.1.2 
etc etc.

I have already used this code in an ipod app and it works properly on that.

I would appreciate any help that anyone can provide and am happy to provide 
more information if asked.

Thanks 

Niall

Original issue reported on code.google.com by niall_mo...@hotmail.com on 15 Jan 2014 at 1:33

GoogleCodeExporter commented 9 years ago
Hi Niall, 

I am using below code for select image region for crop. Server side using php 
to crop.

$('#cropbox').Jcrop({
    onSelect: updateCoords,
    onChange: updateCoords,
    aspectRatio: 1,                 
    allowResize:true,
    setSelect:   [ 0,0,300,300 ],
    allowSelect: true,
    boxWidth: 450, 
    boxHeight: 400 
});
function updateCoords(c)
{
    $('#x').val(parseInt(c.x));
    $('#y').val(parseInt(c.y));
    $('#w').val(parseInt(c.w));
    $('#h').val(parseInt(c.h));
}
then on save posting this value to php server.

its working fine in browser but Tablet app its not working.

If I upload big image and try to select some region it takes wrong co-ordinates 
and cropping other region.

Any suggestion ?

Original comment by santosh8...@gmail.com on 8 Jan 2015 at 12:29