Skip to content

Commit

Permalink
use advence-cropper to solve issue #86
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Sep 10, 2021
1 parent d2cfb74 commit 0d2533a
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions src/views/QuestionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,28 @@
<div class="ui big label">{{ currentQuestion.value }}</div>
</div>
<div class="ui divider hidden"></div>
<viewer :options="imageZoomOptions" style="height: 300px">
<img
:class="[imageRotationClassName]"
:src="currentQuestionImageUrl"
style="max-height: 300px; max-width: 300px"
/>
</viewer>
<cropper
style="max-height: 300px; max-width: 300px"
:src="currentQuestionImageUrl"
:canvas="false"
:checkOrientation="false"
:crossOrigine="false"
:default-position="{
left: 0,
top: 0,
}"
:default-size="
({ imageSize }) => ({
width: imageSize.width,
height: imageSize.height,
})
"
:stencil-props="{
handlers: {},
movable: false,
resizable: false,
}"
/>
<div class="ui divider hidden"></div>

<div>
Expand Down Expand Up @@ -129,6 +144,7 @@
</template>

<script>
import { Cropper } from "vue-advanced-cropper";
import robotoffService from "../robotoff";
import Product from "../components/Product";
import LoadingSpinner from "../components/LoadingSpinner";
Expand Down Expand Up @@ -180,7 +196,6 @@ const insightTypesNames = {
const randomInsightTypeChoices = ["label", "category", "brand"];
const countryNames = [
"en:belgium",
"en:denmark",
Expand Down Expand Up @@ -243,7 +258,7 @@ const reformatValueTag = (value) => {
export default {
name: "QuestionView",
components: { Product, AnnotationCounter, LoadingSpinner },
components: { Product, AnnotationCounter, LoadingSpinner, Cropper },
data: function() {
return {
valueTag: getURLParam("value_tag"),
Expand Down

0 comments on commit 0d2533a

Please sign in to comment.