Coder Social home page Coder Social logo

Comments (13)

mohsinali1317 avatar mohsinali1317 commented on August 21, 2024

I think its because on line 215 in your plugin this.img_top = fill((this.options.height - this.img_height) / 2, this.img_height, this.options.height);. I don't know why but the variable this.img_top is not destroyed or I think it is destroyed but it had applied the css on the image. Because if in this line I write this this.img_top = 0; then it is working. But I am assuming it would be having trouble on drag calculation. Do you think you have any solution for it?

from jquery-cropbox.

acornejo avatar acornejo commented on August 21, 2024

From your description, it seems that the old cropbox is NOT being removed.

I am surprised that the new image preserves the same top: -X value, but not the same left: -Y value.

How are you removing the cropbox? You should be doing $('imageselector').data('cropbox').remove()

I ask because a lot of people do $('imageselector').cropbox().remove() but that is wrong since cropbox is a chainable function, and it returns the image, not the cropbox instance.

from jquery-cropbox.

mohsinali1317 avatar mohsinali1317 commented on August 21, 2024

I am removing it like this,
var crop = $('#postcar_image').data('cropbox');
crop.remove();
Yeah I am not sure why it isn't removing it properly. if I do this this.img_top = 0; on line 215 in your code then it works. I mean the the new image isn't having any top values. But I don't think it is the right way to do it. Do you want me to share the link with you so that you can have a look?

from jquery-cropbox.

acornejo avatar acornejo commented on August 21, 2024

Sure, a link to a jsfiddle would help.

It seems you are removing the cropbox correctly.

from jquery-cropbox.

mohsinali1317 avatar mohsinali1317 commented on August 21, 2024

http://pprdev.onjumpstarter.io/resapp/#/selectImage try and select an image which has higher height as compared to the width and then select another one with higher width. You will see that the new image is having some top: - X value..

from jquery-cropbox.

acornejo avatar acornejo commented on August 21, 2024

I can't reproduce the issue you see with the top value, but I can see the cropbox is NOT being removed, because I run into different issues (width and height are not being refreshed).

Try using the latest version in master and see if it fixes your issue.

from jquery-cropbox.

mohsinali1317 avatar mohsinali1317 commented on August 21, 2024

No it still doesn't fixes the issues. Let me give you the images to upload as well so that you can see the problem what I am talking about.
5 issues First upload this one and then add this one
abc

from jquery-cropbox.

mohsinali1317 avatar mohsinali1317 commented on August 21, 2024

So when you upload the horse one it has top: -X value.

from jquery-cropbox.

acornejo avatar acornejo commented on August 21, 2024

Ok, let me try (also, please update again, I forgot to push the change to github).

from jquery-cropbox.

mohsinali1317 avatar mohsinali1317 commented on August 21, 2024

After updating I am still having that same issue.

from jquery-cropbox.

acornejo avatar acornejo commented on August 21, 2024

Now I can reproduce the problem in your example. I have to go to work now, but this is now at the top of my priority list when I get back from work.

PS: The example in the sandbox you sent me IS NOT using the latest version of jquery cropbox, but I assume you tried it with the latest version in another sandbox.

from jquery-cropbox.

mohsinali1317 avatar mohsinali1317 commented on August 21, 2024

yeah on my local machine I tried with the latest code. Thanks a lot for your response. I will wait for you to fix the thing meanwhile if I fix it I will let you know.

from jquery-cropbox.

mohsinali1317 avatar mohsinali1317 commented on August 21, 2024

This is resolved, there wasn't problem with your plugin but with my code.. I am trying to use ember to bind the src attr of the image and then it wasn't allowing to remove the cropbox. Now I have removed it and it is working now..

from jquery-cropbox.

Related Issues (20)

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.