anvaka / anvaka/ngraph

How do I load filtered data?

Open
#34 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
1.5k
Forks
130
PR merge metrics
No merged PRs in 30d

Description

Please help me.
The following serialized data can be loaded with **loadFromJSON()**
`{"objects":[{"type":"image","originX":"center","originY":"center","left":72.5,"top":91.5,"width":658,"height":982,"fill":"rgb(0,0,0)","stroke":null,"strokeWidth":0,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,"scaleX":0.22,"scaleY":0.22,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"crossOrigin":"","cropX":0,"cropY":0,"src":"https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=361494400,3587695219&fm=27&gp=0.jpg","filters":[]}]}`

but the following serialized data cannot be loaded with **loadFromJSON()**
`{"objects":[{"type":"image","originX":"center","originY":"center","left":96.5,"top":186.5,"width":658,"height":982,"fill":"rgb(0,0,0)","stroke":null,"strokeWidth":0,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,"scaleX":0.46,"scaleY":0.46,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"crossOrigin":"","cropX":0,"cropY":0,"src":"https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=361494400,3587695219&fm=27&gp=0.jpg","filters":[{"type":"Saturation","saturation":"0.913448"}]}]}`

_Here is my code_
```
var canvas = new fabric.Canvas('c');
canvas.setWidth(500)
canvas.setHeight(500)

canvas.loadFromJSON('{"objects":[{"type":"image","originX":"center","originY":"center","left":96.5,"top":186.5,"width":658,"height":982,"fill":"rgb(0,0,0)","stroke":null,"strokeWidth":0,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,"scaleX":0.46,"scaleY":0.46,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"crossOrigin":"","cropX":0,"cropY":0,"src":"https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=361494400,3587695219&fm=27&gp=0.jpg","filters":[{"type":"Saturation","saturation":"0.913448"}]}]}', canvas.renderAll.bind(canvas));
```

How do I load filtered data?

Contributor guide

No contributing guide indexed for this repository

Research direction

Begin with the loadFromJSON call and compare the two serialized image objects, especially the filters; reproduce the behavior using the provided canvas snippet. The issue names no repository files or tests, so the payload does not identify a completion check beyond successful loading of the filtered image.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.