Skip to content

Commit

Permalink
Merge pull request #758 from xyxiao001/fix_xxy_base_length
Browse files Browse the repository at this point in the history
fix: 修复 base64 部分图片展示问题
  • Loading branch information
xyxiao001 authored Sep 7, 2023
2 parents bdbdd54 + 39cf35d commit ed8469d
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 更新日志
## vue3.x组件更新日志
### v1.1.1
修复部分 base64 图片长度导致展示问题


### v1.1.0
- 修复 exif 读取图片出错的情况
- 新增 @imgLoadError方法返回对应错误
Expand Down Expand Up @@ -32,6 +36,8 @@
- 支持 `vue3` 版本

## vue2.x组件更新日志
### v0.6.4
修复部分 base64 图片长度导致展示问题
### v0.6.3
- 修复 exif 读取图片出错的情况
- 新增 @imgLoadError方法返回对应错误
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions next/dist/vue-cropper.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function E(t, e) {
}
function L(t, e) {
e = e || t.match(/^data\:([^\;]+)\;base64,/mi)[1] || "", t = t.replace(/^data\:([^\;]+)\;base64,/gmi, "");
for (var i = atob(t), s = i.length, r = new ArrayBuffer(s), o = new Uint16Array(r), h = 0; h < s; h++)
for (var i = atob(t), s = i.length % 2 == 0 ? i.length : i.length + 1, r = new ArrayBuffer(s), o = new Uint16Array(r), h = 0; h < s; h++)
o[h] = i.charCodeAt(h);
return r;
}
Expand Down Expand Up @@ -1070,7 +1070,7 @@ function U(t, e, i, s, r, o) {
const W = /* @__PURE__ */ N(A, [["render", U], ["__scopeId", "data-v-69939069"]]), F = function(t) {
t.component("VueCropper", W);
}, j = {
version: "1.1.0",
version: "1.1.1",
install: F,
VueCropper: W
};
Expand Down
4 changes: 2 additions & 2 deletions next/dist/vue-cropper.umd.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion next/lib/exif-js-min.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ function base64ToArrayBuffer(base64, contentType) {
contentType = contentType || base64.match(/^data\:([^\;]+)\;base64,/mi)[1] || ''; // e.g. 'data:image/jpeg;base64,...' => 'image/jpeg'
base64 = base64.replace(/^data\:([^\;]+)\;base64,/gmi, '');
var binary = atob(base64);
var len = binary.length;
// byte length of Uint16Array should be a multiple of 2
var len = binary.length % 2 == 0 ? binary.length : binary.length + 1;
var buffer = new ArrayBuffer(len);
var view = new Uint16Array(buffer);
for (var i = 0; i < len; i++) {
Expand Down
2 changes: 1 addition & 1 deletion next/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const install = function(app: App) {
}

export const globalCropper: vueCropperGlobal = {
version: '1.1.0',
version: '1.1.1',
install,
VueCropper,
}
Expand Down
2 changes: 1 addition & 1 deletion next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-cropper",
"version": "1.1.0",
"version": "1.1.1",
"description": "A simple Vue picture clipping plugin",
"keywords": [
"vue",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-cropper",
"version": "0.6.3",
"version": "0.6.4",
"description": "A simple Vue picture clipping plugin",
"keywords": [
"vue",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (typeof window !== 'undefined' && window.Vue) {
export { VueCropper }

export default {
version: '0.6.3',
version: '0.6.4',
install,
VueCropper,
vueCropper: VueCropper
Expand Down

1 comment on commit ed8469d

@vercel
Copy link

@vercel vercel bot commented on ed8469d Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vue-cropper – ./

vue-cropper-git-main-463618622.vercel.app
vue-cropper-463618622.vercel.app

Please sign in to comment.