advanced-cropper / vue-advanced-cropper

The advanced vue cropper library that gives you opportunity to create your own croppers suited for any website design
https://advanced-cropper.github.io/vue-advanced-cropper/
Other
977 stars 132 forks source link

Cropper appears with way to much 'height' #129

Closed eMZetta closed 3 years ago

eMZetta commented 3 years ago

I have following problem with implementing the minimal example:

I try to make it exactly according to the served example, but the image appears in the browser only after several scrolls way too far down.

This is a PrintScreen from the browser zoomed out 75%: browser

Elements in development tools: Bildschirmfoto von 2021-04-10 18-28-59

Here is my code:

<div>
                    <cropper
                        class="cropper"
                        :src="img"
                        :stencil-props="{
                            aspectRatio: 10/12
                        }"
                        @change="change"
                    ></cropper>
</div>

img: string = 'https://images.pexels.com/photos/226746/pexels-photo-226746.jpeg';

change(){
        console.log('changed');
    }
.cropper {
    height: 600px;
    background: #DDD;
}

I hope my problem can be understood, thanks in advance

Norserium commented 3 years ago

@eMZetta, I assume that you didn't import the cropper's styles: import 'vue-advanced-cropper/dist/style.css';

By the way, where did you find this minimal example?

eMZetta commented 3 years ago

I assume that you didn't import the cropper's styles: import 'vue-advanced-cropper/dist/style.css';

That caused not the problem. I've imported the styles.

By the way, where did you find this minimal example?

https://www.npmjs.com/package/vue-advanced-cropper in the 'Usage'-section

/ Maybe you need to set the limits for the cropper sizes or its container sizes otherwise a cropping image will try to fill all available space /

What exactely is meant with this?

Norserium commented 3 years ago

@eMZetta, could you reproduce your problem in codesandbox? May you provide more source code?

What exactely is meant with this?

Cropper tries to take all available place for its image. For the used image it's 3698 x 5547.

eMZetta commented 3 years ago

Finally, shame on me, this is embarrassing. I had the wrong path to the style.css file. After I fixed the path, everything works fine.

I was able to solve it thanks to your reference to the codesandbox. You can reproduce my issue just deleting the import statement of the style.css.

@Norserium Thank you a lot for your support and this great component!

Norserium commented 3 years ago

@eMZetta, it's okay. You are welcome!