Upload photo with vertical orientation & added remote file upload handler #746
|
@ -61,7 +61,7 @@
|
|||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete
|
||||
label="Type"
|
||||
label="Orientation"
|
||||
ng-model="$ctrl.viewportType"
|
||||
data="$ctrl.viewportTypes"
|
||||
selection="$ctrl.viewportSelection"
|
||||
|
|
|
@ -36,6 +36,18 @@ export default class UploadPhoto extends Component {
|
|||
width: 1350,
|
||||
height: 900
|
||||
}
|
||||
},
|
||||
{
|
||||
code: 'vertical',
|
||||
description: this.$t('Vertical'),
|
||||
viewport: {
|
||||
width: 306.66,
|
||||
height: 533.33
|
||||
},
|
||||
output: {
|
||||
width: 460,
|
||||
height: 800
|
||||
}
|
||||
}
|
||||
];
|
||||
this.viewportType = 'normal';
|
||||
|
@ -103,8 +115,17 @@ export default class UploadPhoto extends Component {
|
|||
const reader = new FileReader();
|
||||
reader.onload = e => this.editor.bind({url: e.target.result});
|
||||
reader.readAsDataURL(value);
|
||||
} else if (this.uploadMethod == 'URL')
|
||||
this.editor.bind({url: value});
|
||||
} else if (this.uploadMethod == 'URL') {
|
||||
const img = new Image();
|
||||
img.crossOrigin = 'Anonymous';
|
||||
img.src = value;
|
||||
img.onload = () => this.editor.bind({url: value});
|
||||
img.onerror = () => {
|
||||
this.vnApp.showError(
|
||||
this.$t(`This photo provider doesn't allow remote downloads`)
|
||||
);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ Select an image: Selecciona una imagen
|
|||
File name: Nombre del fichero
|
||||
Rotate left: Girar a la izquierda
|
||||
Rotate right: Girar a la derecha
|
||||
Panoramic: Panorámico
|
||||
Panoramic: Panorámica
|
||||
Orientation: Orientación
|
||||
Select from computer: Seleccionar desde ordenador
|
||||
Import from external URL: Importar desde URL externa
|
||||
Import from external URL: Importar desde URL externa
|
||||
This photo provider doesn't allow remote downloads: Este proveedor de fotos no permite descargas remotas
|
Loading…
Reference in New Issue