-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Cropping HEIC Files on Apple Devices #279
Comments
@arachimi, you can use <cropper
:src="image"
:canvas="{
maxHeight: canvasSize.maxHeight,
maxWidth: canvasSize.maxHeight,
maxArea: canvasSize.maxArea,
}"
/> Perhaps, it should be a part of the cropper library, but I'm not sure because it will increase the library size the cropper's and users usually set the canvas size limitations anyway. |
Thank you for your suggestion. I tried setting the cropper size smaller, but I still encounter the same issue. What do you think? |
@arachimi, could you provide the source code and error text? |
@Norserium Thank you. I will provide source code below. Template :
Vue:
After crop process it's show black image. Could you please point out where I went wrong or what mistakes I made? |
@arachimi, you are doing it incorrectly. The cropper already has a functional to resize a canvas. <template>
<div class="cropper-wrapper">
<div class="image-wrapper">
<div :style="{ backgroundImage: 'url(' + img + ')' }" class="cropper" />
<Cropper
classname="upload-example-cropper"
imageClassname="imgName"
:src="img"
ref="cropper"
@change="change"
:stencil-props="{
handlers: {
eastNorth: true,
north: false,
westNorth: true,
west: false,
westSouth: true,
south: false,
eastSouth: true,
east: false,
},
movable: true,
scalable: true,
minAspectRatio,
maxAspectRatio,
autoZoom: true,
}"
:canvas="{
maxWidth: 4096,
maxHeight: 4096,
maxArea: 4096 * 4096,
}"
/>
</div>
<div class="button-wrapper">
<f7-button class="rotate-button" @click="rotateLeft" style="margin-left: auto">
<img src="static/svg/RotateLeft.svg" alt="Rotate Left Icon" />
</f7-button>
<f7-button class="rotate-button" @click="rotateRight" style="margin-right: auto">
<img src="static/svg/RotateRight.svg" alt="Rotate Right Icon" />
</f7-button>
</div>
</div>
</template> |
@Norserium I have change code to basic version.
I have made a video example for you to see as well At first, when I select a normal image, you can see that the app can select and crop the image normally. But my problem is that there are some images that it cannot crop. I have sent a sample image file for you to check in the first comment, which is this file: https://drive.google.com/file/d/1WOKcNmwsCHKGt95KKLBYe7W-eInZu0Nd/view The mentioned image is an adapter charging cable image. I'm not sure why when this file is selected, it cannot be cropped. How can I fix it? I have attached a video example showing my usage steps for you to watch and check. https://drive.google.com/file/d/1qeOLXSWq2mQo0FEL8Gam1KZdMrzqcD3i/view?usp=drive_link And finally, I have attached the log from the Safari Console. Note: I am using Mobile Safari for testing. |
@arachimi, you should pass |
@Norserium Okay. Do you mean this prop?
Here is the result: Thank you. |
Dear Developer,
I encountered a problem with cropping HEIC files from the Apple Gallery. When I select a file from the Gallery and attempt to crop it, I receive the following error from the Safari log:
"Canvas area exceeds the maximum limit (width * height > 16777216)."
This might be causing the crop function to fail.
I have attached a sample file with the issue in this Google Drive link:
https://drive.google.com/file/d/1WOKcNmwsCHKGt95KKLBYe7W-eInZu0Nd/view?usp=drive_link
You can also test it on this website:
https://codesandbox.io/embed/vue-advanced-cropper-composition-api-5z0ww0?codemirror=1
I tried it on Safari iOS and found that after cropping, the resulting image is black.
Thanks as always
The text was updated successfully, but these errors were encountered: