Skip to content

Releases: zhanziyang/vue-croppa

v1.1.3

19 Nov 09:22
Compare
Choose a tag to compare
  • Fixing a serious bug: promisedBlob() 's arguments were not applied correctly, which resulted in compression not working.

v1.1.2

03 Nov 01:51
Compare
Choose a tag to compare

Change Log:

  • Fixing callback fire twice when there is no image (A careless mistake in the last release) 30cf35f.

v1.1.1

02 Nov 04:18
Compare
Choose a tag to compare

Change Log:

v1.1.0: Add Loading Support

26 Oct 07:04
Compare
Choose a tag to compare

Change Log:

  • New props: show-loading, loading-size, loading-color to show/hide/style the built-in spinner at the bottom right corner that will show up only when a image is loading (will but not yet drawn on canvas).

  • New events: loading-start, loading-end

  • Unnamed (default) slots now will be appended to the .croppa-container instead of being ignored. Usually you need to set position: absolute on these slots or it will expand the container. It can be useful to make a custom loading if you find the built-in loading not fancy enough.

  • New boolean type state data loading indicates whether an image is loading.

  • Related issue: #41 , #40

  • Bundle size has increased by 3kb.

v1.0.5

13 Oct 07:46
Compare
Choose a tag to compare

Change Log:

  • Add a new data field currentIsInitial to differentiate between initial image and non-initial image. You can now check if the current image is initial image like this:
this.myCroppa.currentIsInitial // true or false
  • Fix a few bugs where prevent-white-space fails in various situations.

v1.0.4

06 Oct 10:37
Compare
Choose a tag to compare

Change Log:

v1.0.3

05 Oct 02:20
Compare
Choose a tag to compare

Change Log:

v1.0.2

29 Sep 08:38
Compare
Choose a tag to compare

Change Log:

  • Fixing prop validation of the quality prop. It doesn't need to be an integer (a stupid mistake).

v1.0.1

27 Sep 14:56
Compare
Choose a tag to compare

Change Log:

  • Fixing some bugs from the last release:
    1. applyMetadata() wrong position bug.
    2. Wrong apect ratio after rotating.

v1.0.0

27 Sep 10:59
Compare
Choose a tag to compare

Change Log:

  • BIG CHANGE! Now the instance is the component itself and the methods we can use are simply the methods of the component. This means that for a template like this,
<croppa ref="croppa" v-model="myCroppa"></croppa>

<!-- note that "myCroppa" and "croppa" are just examples, 
you can give them other names. -->

we have the v-modeled value and the ref point to the same thing.

this.$refs.croppa === this.myCroppa // true

and we can now access the component state data via the "v-modeled" value:

this.myCroppa.outputWidth
this.myCroppa.dragging
this.myCroppa.imgData
this.myCroppa.naturalHeight
this.myCroppa.scaleRatio
this.myCroppa.originalImage
this.myCroppa.canvas
this.myCroppa.ctx
// ... checkout vue devtool to see more

and the same methods that are used to called by the v-modeled (this.myCroppa) can also be called by the ref (this.$refs.croppa).

var croppa = this.$refs.croppa
croppa.chooseFile()
croppa.remove()
croppa.generateDataUrl()
croppa.generateDataUrl()
croppa.getMetadata()
// ...

which also means that we don't even need the v-modeled value anymore. Just use the ref, it feels more natural for me. But it's just a matter of preference.

  • scaleRatio is now reactive. Changing it will cause zooming. It's useful if you want to make a zooming slider. (#28)
this.myCroppa.scaleRatio += 0.001 // zooming in
  • New event: @new-image-drawn emitted when a new image is drawn on canvas for the first time. (#30)

  • BREAKING CHANGE: accept's default value is now removed due to its incompatibility in different browsers. Please specify it as you need. Now, by default the users can choose a non-image file but nothing will happen.

  • New prop: :input-attrs to pass attributes to the hidden input[type=file] element.

<croppa :input-attrs="{capture: true, class: 'file-input'}"></croppa>
  • New methods: move() and zoom() are now exposed for more flexibility.

  • Deprecated: getActualImageSize() is now deprecated. Use this.myCroppa.outputWidth and this.myCroppa.outputHeight instead.

  • Fixing a few bugs. (including #29)


Edit: There is a new bug in this release with applyMetadata() which will be fixed in the next release.