Giter Club home page Giter Club logo

vue-cropper's People

Contributors

akiq2016 avatar chenhw2017 avatar dependabot[bot] avatar doter1995 avatar epsirom avatar fxxqq avatar gguney avatar hzsrc avatar imaxing avatar kylebing avatar laqking avatar lylanfeng avatar mmk909 avatar moudicat avatar panghuangdehaozi avatar peterchen1997 avatar powolnymarcel avatar qiupanfeng avatar senasiko avatar unsad avatar xyxiao001 avatar yiiu avatar yxzt 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  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  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

vue-cropper's Issues

能否让大尺寸的图片按照原始尺寸初始化?

能否让大尺寸的图片按照原始尺寸初始?或者是50%放大倍数初始化。。

这里有个需求是,用户用手机对着桌子上的文件拍照,然后通过这个上传。部分用户不会去缩放,直接传上来了。原本手机拍出来一个1920X1080的图 变长了一个极小的图。所有的文字都看不清。所以 如果这个插件能实现,当用户选择了图片之后,展示给用户的是一张放大了的,用户就会自己去选择需要截图的位置。

java后台如何获取image值啊?

我现在不知道java后台如何获取这个data值

this.$refs.cropper.getCropData((data) => {
                this.$refs.avatarForm.reset();
                this.$post(`${this.$url}/teacher/uploadFileToQiniu`,{
                    imgStream : data
                })
                .then(res=>{

                })
                .catch(err=>{

                })
            })

不支持在Modal中使用

在使用iview的Modal组件中嵌入本插件,
Modal刚刚开始是隐藏的,点击按钮打开后,
初始化的数据全部失效,而且也无法切图,如下图所示
08ff7ca8-31d5-4c0f-904a-962209c344a8

怎么设置viewMode参数?

在手机上图片比例没有铺满,看了cropper文档里面有viewMode,但是在你开发的vue-cropper上好像缺少了这个支持,那么怎么设置viewMode?

指定截图尺寸大小

当按原图比例输出时(即 props = true)
1、指定截图尺寸大小
2、指定截图的最大宽度,当截图宽度大于最大宽度时,按照最大宽度输出

不能等比例缩放截图框? 宽高一比一

html

                     <VueCropper
                            ref="cropper"
                            :img="example2.img"
                            :outputSize="example2.size"
                            :outputType="example2.outputType"
                            :info="example2.info"
                            :canScale="example2.canScale"
                            :autoCrop="example2.autoCrop"
                            :autoCropWidth="example2.width"
                            :autoCropHeight="example2.height"
                    ></VueCropper>

js

                    img: 'http://ofyaji162.bkt.clouddn.com/bg1.jpg',    // 图片地址
                    info: false,    // 宽高信息
                    size: 1,        // 图片质量
                    outputType: 'jpeg', // 输出格式
                    canScale: false,    // 底图是否缩放
                    autoCrop: true,     // 自动截图框
                    // 只有自动截图开启 宽度高度才生效
                    autoCropWidth: 300,
                    autoCropHeight: 250,
                    // 开启宽度和高度比例
                    fixed: true,
                    fixedNumber: [1, 1],

ios拍照之后无法显示在剪辑图片容器中?

1.拍完照之后,报错canvas.toBlob is not a function
pfnet/PaintsChainer#51
尝试了下vue-cropper依赖exif-js降级到2.2.0版本也不会报错,但是还是会出现下面的问题

2.用这个方法解决后,没有报错,但是还是无法在剪辑局域正常显示所拍照片

测试机型:iPhone5s(IOS 8.1)、iPhone 7 plus(IOS10.3.3)

设置vue-cropper有点问题,能不能帮我看下是哪里出现的问题?

image

<template>
  <div class="edit-teacher-container">
        <Card>
                <div slot="title">
                    <Button type="text" icon="reply" @click.native="returnTeacherPage">返回</Button>
                </div>          
                <Button slot="extra" type="primary" icon="plus-round" @click.native="saveTeacher">保存</Button>
                <Row :gutter="16">
                    <Col span="10">
                        <Card style="height:500px">
                            <p slot="title">
                                <Icon type="person"></Icon>
                                设置老师头像
                            </p>
                                <Button type="primary" @click="modal1 = true">上传文件</Button>


                        </Card>
                    </Col>
                </Row>
        </Card>

        <Modal
            v-model="modal1"
            title="设置老师头像"
            width=800
            @on-ok="ok"
            @on-cancel="cancel">
            <vueCropper
                ref="cropper2"
                :img="example2.img"
                :outputSize="example2.size"
                :outputType="example2.outputType"
                :info="example2.info"
                :canScale="example2.canScale"
                :autoCrop="example2.autoCrop"
                :autoCropWidth="example2.width"
                :autoCropHeight="example2.height"
                :fixed="example2.fixed"
                :fixedNumber="example2.fixedNumber"
            ></vueCropper>
    </Modal>
  </div>
</template>
<script>
import vueCropper from 'vue-cropper'


export default {
    components:{
        vueCropper
    },
data () {
    return {
        modal1: false,
        example2: {
				img: 'http://ofyaji162.bkt.clouddn.com/bg1.jpg',
				info: true,
				size: 1,
				outputType: 'jpeg',
				canScale: false,
				autoCrop: true,
				// 只有自动截图开启 宽度高度才生效
				autoCropWidth: 300,
				autoCropHeight: 300,
				// 开启宽度和高度比例
				fixed: true,
				fixedNumber: [1, 1]
			}
    }
}
</script>


上传服务端

如何将裁剪的数据传递给服务端,getCropData这个方法返回的只是一个base64编码,getCropBlob这个方法返回的是blob,这个blob数据是裁剪后的图片的流吗?

设置截图宽高比无效

设置canScale: false,
autoCrop: true,
// 只有自动截图开启 宽度高度才生效
autoCropWidth: 320,
autoCropHeight: 200,
// 开启宽度和高度比例
fixed: true,
fixedNumber: [1, 1]

希望添加服务器渲染支持

RT,我使用nuxt,为这个组件关闭了ssr,但是还是会在浏览器控制台得到一条警告信息。

The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside

, or missing. Bailing hydration and performing full client-side render.

图片旋转的支持

对于网页上传的图片,不是所有的图片展示方向都是正的。所以有旋转图片会更好一点。
==,上传了一个竖着拍的图片,展示方向是横着。

容器内显示不对啊

为什么我用的会是这个样子呢??

image

.avatar-box {
            position: relative;
            height: 500px;
        }
<div class="avatar-box">
                    <VueCropper ref="cropper"
                    :img="option.img"
                    :autoCrop="true"
                    :outputType="option.outputType"></VueCropper>
                </div>

希望添加背景色支持

在我使用透明png图片的时候, 默认切割出来的是黑色背景色,
应该很多人都存在需要透明背景色的需求吧,如下图所示
cropper-touming
gougou-butouming

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.