1

Using ngx-image-cropper in my angular cordova app, how can I disable the default iphone behavior so that when I click on the input this window will not appear, but immediately open the gallery? Is it possible? The ability to take a photo from the camera is not required.

enter image description here

<input type="file" (change)="fileChangeEvent($event)"

<image-cropper
  [imageChangedEvent]="imageChangedEvent"
  [aspectRatio]="4 / 4"
  [resizeToWidth]="256"
  format="png"
  [hideResizeSquares]="false"
  (loadImageFailed)="loadImageFailed()"
  [roundCropper]="true"
  (imageCropped)="imageCropped($event)"
></image-cropper>

<div class="cropper__preview" *ngIf="!errorFormat">
  <img [src]="croppedImage" />
</div>
Bessonniy
  • 71
  • 5
  • 1
    [this post](https://stackoverflow.com/questions/43054349/force-input-type-file-to-open-gallery-in-mobile) may be of interest. – BizzyBob Sep 14 '22 at 09:02

1 Answers1

0

I found out that in such cases it is better to use @ionic-native/camera and cast to ngx-image-cropper not with imageChangedEvent, but through imageBase64

Bessonniy
  • 71
  • 5