Open TwunTee opened 5 years ago
Hi @TwunTee
Can you tell me more about the workflow? Are you using a widget with the "multiple" mode enabled or a user uploads files one by one? What happens after uploading? If possible, share your code snippet so I can look into it.
Yes i am using the widget with multiple mode enabled. The workflow will be like the widget has multiple option set to true and a user uploads multiple images either one by one or select all the images in one go either way once multiple images are selected the aspect ratio should be changed from free to the aspect ratio of the first image so that aspect ratio is same for all the images.
Would be good if the preview is shown with the aspect ratio changed instead of mini images.
The problem I am facing is that when the user uploads multiple images and their aspect ratio is different then when they get displayed on the mobile, it looks weird with one image having a different height, gets cropped out or zoomed in.
// Angular example
<ngx-uploadcare-widget
[images-only]="true"
image-shrink="1024x1024 95%"
[multiple]="true"
tabindex="-1"
[crop]="true"
(on-change)="onChange($event, 'images')"
(on-upload-complete)="imageUploadHandler($event)"
public-key="{{uploadcareKey}}">
</ngx-uploadcare-widget>
@optlsnd Hi any updates on this. Was the explanation ok or do I need to give more info?
@optlsnd @Zmoki Any updates or suggested workaround for this issue.
@TwunTee I'm sorry for such a long delay with the reply. Technically, there's no way to update widget's crop settings on the run. However, if you define a specific aspect ratio in crop settings, it will be applied to all uploaded images automatically. You can add aspect ratio validation to pass images with a certain aspect ratio or orientation only. Hope that helps.
Is it possible to use free crop for the first image and then apply its aspect ratio to other images too. I am trying to do something similar to how instagram does. User uploads his images, first image aspect ratio is fetched and then it is applied to other images too, so that when using it in a carousel the size of the container can remain the same. I tried using onchange, but it is triggered after the user clicks on add, if there is a trigger to know when the user has selected the image that would be good too.