Git Product home page Git Product logo

rcrop's People

Contributors

aewebsolutions avatar manchumahara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rcrop's Issues

initalizing RCrop on images with secured src url fails on Safari

First of all;
The issue does not occur in Chrome, FireFox, Edge. It seems to only occur in Safari.
However, I do think it is strange that it does only occur in Safari. (I think it should occur everywhere).

What happens.
RCrop creates a new Image() at initialization and uses the src url of the original image.
(Note that our images are not allowed to be served cross origin.)
On the new Image, you set the attribute 'crossOrigin' = 'anonymous', which should cause the session cookies not to be sent. (this is the case in Safari, but not in Chrome, FireFox and Edge).

So, in Safari, initializing RCrop causes a load of the image, which causes a 302 redirect to the loginPage, which is obviously not what we want.

patching our rcrop.min.js by changing the 'crossOrigin=anonymous' to 'use-credentials' did fix our problem.

Is there a reason why the 'crossOrigin' is explicitly set to anonymous? Why not 'use-credentials'?
At least, I think this should be a configuration option.

Thanks.

Scaling and movement issues on mobile causing negative crop values.

When I scale my crop and move it to the top and keep repeating that action - my crop becomes larger, even though the image is already cut off at the top. Causing me to save negative values and a black line to appear when the crop is complete.

Here is a video of what's happening:
https://user-images.githubusercontent.com/11331341/109075914-c7f19580-76c7-11eb-8510-166f814b1add.mov

Here is my code:


$('#myFile').change(function () {
        console.log('changed')
        const img_data = input.files[0]
        const url = URL.createObjectURL(img_data)
        imageBox.innerHTML = `<img src="${url}" id="image" width="100%">`

        $('#image').rcrop({
            full : true,
            minSize : [100,125],
            preserveAspectRatio : true,
            grid : true
        });
}

isTouchDevice is not defined error

Hi, where is the isTouchDevice() function? It is not inside rcrop.js.

Upd. I see it's there inside rcrop.min.js. But src file seems to be broken.

Support For Touch events

Im a little confused does your cropping solution support touch events? I checked the code and there are touch events defined but the crop doesn't seem to respond to touch events at all...

Cors error

image

Even after adding the CORS config, when the rcop initialises the images getting the following cors error.

image

How to set the minSize after image onload event.

Hi,

I tried the below code on which I applied the crop on the image Onload event. it set the minSize properly but after that resizing image is not working like reducing the size from the front end is not working.

        var img = new Image()
        img.src = 'images/demo.jpg';
        img.onload = function () {

            let size = 0;
            if (this.width <= this.height) {
                size = this.width;
            }
            else {
                size = this.height;
            }
            debugger;

            $('#image-4').rcrop({
                minSize: [size, size],
                preserveAspectRatio: true,
            });

        };

Untitled

minSize set properly what I wanted but when I try to reduce the cropbox while drag its not working

Image Preview Showing First image for all images while cropping

I tried to replace the image and crop it again but while i save the image it's the first image that gets saved.
Actually i have table with multiple images in td.if i click the image in td ..then the image will be opened in popup.if i resize the image the first image will displayed as preview for every image clicks.
Can you please check this issue?

after uploading new image getDataURL is not getting updated

After uploading new image, when I try to crop or resize it, image getDataURL var srcOriginal = $('#image-3').rcrop('getDataURL'); is not getting updated.
$('#image-3').on('rcrop-changed', function(){ var srcOriginal = $('#image-3').rcrop('getDataURL'); $('#cropped-resized').html('<img style="width: 80px; height: 120px; margin-left:30px; margin-right: 30px;" src="'+srcOriginal+'">'); });

How to activate/deactivate rcrop on a image?

Is it possible to somehow unload rcrop on a image? I tried to set the grid to false, but that doesnt help. How can I deactivate rcrop on a image?


<script>
$(document).ready(function(){
		// Activate or deactivate crop
		var cropIsActive = 1; // some variable that holds the state
		if(cropIsActive === '1'){
			$('#imgx').rcrop({
				grid : true
			});

		}
		else{
			$('#imgx').rcrop({
				grid : false
			});
		}
});
</script>

Off canvas

Hello - I am using a basic implementation of rcrop and it is always cropping off the image canvas when I move it. Why would this occur? Advice would be appreciated!

Syntax error

Can be seen in rcrop.js on line 111 and 114.
The extra quotation in html.
written
...handler-corner"">
but you need
...handler-corner">
As a result, the valid layout of the plugin is broken.
But the plugin itself is very good. Thank you very much.

not working selection area into mobile devices

Hi Team,

Great job for the responsive crop feature, but selection area is not working in the mobile devices.

I want to crop by mobile, but it is unable to drag the selection area.

Please suggest and reply me ASAP.

Kind Regards

Mantain aspect only functions on first image

This appeared for me after loading 2-3 images in a row.
Init the cropper tool on the first image using (image is not a 1:1 square but close)
$('#cropArea').rcrop({minSize: [100, 100], preserveAspectRatio: true, grid: true});
now load another picture into memory (16:9) then another (16:9), now check the crop area and you will find its no longer a 1:1 aspect ratio.
It did seem to retain the 1:1 for the first and second image for me but upon loading the third in the aspect seems to have reset itself and now maintains the aspect of the image and not the one set in code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.