Giter Club home page Giter Club logo

Comments (15)

darul75 avatar darul75 commented on July 28, 2024

We made some changes and problem has been resolved with "parent" property. You can can close this bug I guess. Thanks.

from imgareaselect.

darul75 avatar darul75 commented on July 28, 2024

When using "parent", solution we have found is the following by replacing :

while ($p.length) {
    zIndex = max(zIndex,
        !isNaN($p.css('z-index')) ? $p.css('z-index') : zIndex);
    if ($p.css('position') == 'fixed')
        position = 'fixed';

    $p = $p.parent(':not(body)');
}

with

while ($p.length) {
    zIndex = max(zIndex,
        !isNaN($p.css('z-index')) ? $p.css('z-index') : zIndex);
    if ($p.css('position') == 'fixed')
        position = 'absolute';

    $p = $p.parent(':not(body)');
}

from imgareaselect.

notflip avatar notflip commented on July 28, 2024

What is the "parent solution" ?

from imgareaselect.

darul75 avatar darul75 commented on July 28, 2024

hi notflip, sorry a long time ago, I really do not remember, only change I have seen here is position 'fixed' replaced with 'absolute' but....I do not know anymore ;)

from imgareaselect.

notflip avatar notflip commented on July 28, 2024

Hi! I just manage to solve the problem..

Bootstrap 2 was overriding some of the css that was causing this issue, in bootstrap.css

img {
    width: auto\9;
    height: auto;
    /* max-width: 100%; DISABLE FOR IMGAREASELECT */
    vertical-align: middle;
    border: 0;
    -ms-interpolation-mode: bicubic;
}

from imgareaselect.

darul75 avatar darul75 commented on July 28, 2024

Integrating bootstrap (we all do now) means to be careful about its own css properties. But my fix was for environment with no bootstrap at that time.

from imgareaselect.

josephspens avatar josephspens commented on July 28, 2024

@notflip +1 You're awesome... I spent about half a day on this bug sifting my own code before I thought to check the docs.

from imgareaselect.

notflip avatar notflip commented on July 28, 2024

Thanks josephspens. I've also spent tons of time to get imgareaselect working. The trick is to not resize the image with css. Problem is when users upload images that are larger then your screen.

I managed to resize them first with php, before they are loaded in the imgareaselect window, so they're never larger then the users' screen

from imgareaselect.

josephspens avatar josephspens commented on July 28, 2024

What I ended up doing was leaving it 100% width (css resize), but pass into the plugin the original image dimensions. Plugin takes care of itself 👍

from imgareaselect.

notflip avatar notflip commented on July 28, 2024

Doesn't the user get a wrong idea of what the image will look like?

from imgareaselect.

josephspens avatar josephspens commented on July 28, 2024

If you just css resize and use the plugin, then yes. Lets say the resized image is 25% of the original image, and I select all of the newly resized image believing I'm selecting all of it, I would actually be selecting 25% of the image. In my code I'm using this for cropping, so when I would select the entire image (believing it wouldn't crop anything), I would only see the top left corner of my photo.

When you pass in the imageWidth and imageHeight parameters to the plugin, you're telling it what the original image's dimensions are, so the plugin scales everything for you. Now when you select 25% of the resized image, you're selecting 25% of the original image also, not 25% multiplied by the scaling factor.

from imgareaselect.

bimo13 avatar bimo13 commented on July 28, 2024

Hi josephspens,
did you managed to use the "imageWidth" and "imageHeight" option ?

I am currently having a problem with it, I am scaling the image with css (100% width), and I've called the original imageWidth and imageHeight in the option. But, I noticed that I always getting "infinity" on "Y" coordinates and NaN on "H" (height) (I set the hidden-field of "y" into a text-field, and set the option "onSelectEnd" to "setInfo") and the resulting image is not as it is on the previewed area.

Did anyone facing the same problem here ?

Preview :
untitled-1

from imgareaselect.

josephspens avatar josephspens commented on July 28, 2024

@bimo13 my issue was resolved by following the steps I outlined in my comment. I don't remember the situation exactly, but I don't recall getting any of the errors you're seeing.

Coincidentally I'm actually building a new feature which also requires photo cropping, so I may use this plugin. I'll see if I run into this problem again.

from imgareaselect.

bimo13 avatar bimo13 commented on July 28, 2024

@josephspens
Hi there, thanks in advance for your fast response, and sorry to bother you.
It seems like I've found the problem, yet I still can't resolve it.

The thing is, I'm trying to crop preview-selected image before uploading it (I generate a preview right after user browse the image from their computer and set this plugin on that image-preview). That's where the problem started. If I used the actual image (not scaling the image preview with CSS), it has no problem at all. Same thing when I used the image from uploaded image-directory on server, there's no problem at all.

Well, could anyone help me with this ?
Thanks.

from imgareaselect.

bimo13 avatar bimo13 commented on July 28, 2024

All problems solved, sorry to bother you all. Thanks in advance to @odyniec for this wonderful plugin :)

from imgareaselect.

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.