-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Fisheye for GIF #1489
base: main
Are you sure you want to change the base?
[WIP] Fisheye for GIF #1489
Conversation
@harshkhandeparkar can you help me out in this one? |
src/modules/FisheyeGl/Module.js
Outdated
var url1 = canvas2.toDataURL(); | ||
|
||
|
||
distorter.setImage(url1, function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is called first time after extramanipulation is called for all frames of gifs. Is there any way to call this synchronously with each frame as the extramanipulation is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get you. Could you please elaborate? Awesome work btw!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
The only problem is that I want setImage method to be called each time extraManipulation is called i.e the no. of frames in the GIF. But right now the setImage method is called for the first time after the execution of extramanipulation for all the frames are done. Some kind of callback or any way of nesting extramanipulation inside setImage will solve this problem i guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check. Wait a min.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I checked. It is supposed to fire once for every frame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw the AddQR module which kind of uses similar callbacks but is able to put QR on each frame. Maybe that can help. I am working on it.
Codecov Report
@@ Coverage Diff @@
## main #1489 +/- ##
===========================================
+ Coverage 55.11% 65.53% +10.41%
===========================================
Files 117 132 +15
Lines 2344 2742 +398
Branches 360 430 +70
===========================================
+ Hits 1292 1797 +505
+ Misses 1052 945 -107
|
it is only rendering the first frame whereas for the rest it renders white frame. Any reason why this might be happening |
wow! Great work!
…On Thu, Jan 16, 2020 at 6:02 PM Shazeb Ata ***@***.***> wrote:
[image: fisheye-gl (1)]
<https://user-images.githubusercontent.com/32903329/72570089-ee98a680-38e1-11ea-9e20-b23c6a191ecb.gif>
Wohoo it is working now i guess only issue is the output is rotated by 90
deg
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1489?email_source=notifications&email_token=AAAF6J5UJBI32Q2B7HJ32VTQ6DRPDA5CNFSM4KGJGNIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJF3PXI#issuecomment-575387613>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAF6J2X2KYPUC5CQDCS6JTQ6DRPDANCNFSM4KGJGNIA>
.
|
Apparently there is a need to take transpose if the source is gif (dont know why that is happening) but now the code is working perfectly for gif and normal images Edit1: It is only working well for gifs having same dimension along both axis. The main issue is that the pixels get rotated . |
Solved for all kinds of gif @harshkhandeparkar. We need to pass dataurl as it is instead of using canvas to get the url. Wow this issue was a good one |
You already completed this? Wow.
…On Fri, 17 Jan, 2020, 7:09 PM Shazeb Ata, ***@***.***> wrote:
Solved for all kinds of gif @harshkhandeparkar
<https://github.com/HarshKhandeparkar>. We need to pass dataurl as it is
instead of using canvas to get the url. Wow this issue was a good one
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1489?email_source=notifications&email_token=AIJI5HYCWGLF6YQYCJTXAHDQ6GYIDA5CNFSM4KGJGNIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJHWQMI#issuecomment-575629361>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIJI5HYGZLEWTFPHUB7N2ETQ6GYIDANCNFSM4KGJGNIA>
.
|
Do I need to refactor it? |
Please rebase it to fix the conflicts. Ty! |
@@ -314,8 +314,10 @@ module.exports = function PixelManipulation(image, options) { | |||
else resolvedFrames++; | |||
|
|||
if (options.extraManipulation){ | |||
frames[f] = options.extraManipulation(framePix, setRenderState, generateOutput) || framePix; // extraManipulation is used to manipulate each pixel individually. | |||
perFrameShape = frames[f].shape; | |||
getDataUri(frames[f], options.format).then(datauri => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the data URI used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the module (fisheye) we need an image source for distorter to set the image. One option was to put pixels into canvas and get the url using canvas.todataurl() but this failed for gifs as it was making the transpose of that array. Hence to counter that i directly used the source url without using canvas method
Ok I changed the PixelManipulation |
Concerns #1470
Currently in this PR src/modules/FisheyeGl/Module.js the method setImage of distorter is called after all the steps of extramanipulation is called because of being a callback I guess. Is there any way to execute setImage in each call of extramanipulation?
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
npm test
@publiclab/is-reviewers
for help, in a comment belowIf tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
Please make sure to get at least two reviews before asking for merging the PR as that would make the PR more reliable on our part
Thanks!