Skip to content
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

resize before loading previews #1180

Merged
merged 2 commits into from
Jul 22, 2019
Merged

Conversation

aashna27
Copy link

Fixes #922 & #1122

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with npm test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • ask @publiclab/is-reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If 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

Thanks!

@aashna27
Copy link
Author

Now the webpage doesnt fail and gives the preview even for very large image but it does take some time
Crashing-Big

@Divy123
Copy link
Member

Divy123 commented Jul 20, 2019

@aashna27 is it based on what we discussed?

@codecov
Copy link

codecov bot commented Jul 20, 2019

Codecov Report

Merging #1180 into main will decrease coverage by 0.33%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1180      +/-   ##
==========================================
- Coverage   55.78%   55.45%   -0.34%     
==========================================
  Files         114      114              
  Lines        2352     2366      +14     
  Branches      363      364       +1     
==========================================
  Hits         1312     1312              
- Misses       1040     1054      +14
Impacted Files Coverage Δ
examples/lib/insertPreview.js 13.51% <0%> (-8.23%) ⬇️

@aashna27
Copy link
Author

aashna27 commented Jul 20, 2019

@aashna27 is it based on what we discussed?

Yeah sorry I forgot to mention you I made an earlier one today and did mention you there!! 🙊
Yeah so really thankful to @Divy123, he was patient and helped me with what I was stuck with!! 🤗

@Divy123
Copy link
Member

Divy123 commented Jul 20, 2019

@aashna27 thanks for your appreciation.
Though I believe we are a team and it feels great to see this working. I think you have done a fantastic job and removed a big restriction to the usage of IS.

So, cheers for this.

@aashna27
Copy link
Author

@aashna27 thanks for your appreciation.
Though I believe we are a team and it feels great to see this working. I think you have done a fantastic job and removed a big restriction to the usage of IS.

So, cheers for this.

Hehe Thanks @Divy123 for motivating and also please guide me for your pr, I will look for sources!!

@Divy123
Copy link
Member

Divy123 commented Jul 20, 2019 via email

@jywarren
Copy link
Member

jywarren commented Jul 20, 2019 via email

@jywarren
Copy link
Member

jywarren commented Jul 20, 2019 via email

@aashna27
Copy link
Author

Yeah I believe that it is good to merge!

var sequencer = ImageSequencer();

sequencer.loadImage(src, function(){
this.addSteps('resize', {['resize']: '30%'});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we limit to a fixed size? Like 100x100? Because really large images at 30% are still quite large!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but idt we have that option in resize.

@jywarren
Copy link
Member

jywarren commented Jul 20, 2019 via email

@aashna27
Copy link
Author

aashna27 commented Jul 21, 2019

Hey @jywarren I thought about this and I believe that for this I need to change the input values for resize! And take it as 2 dimensions width and height, instead of the currently accepting percentage value. Do you think there is any other way?

Because in the insertPreview file we are just passing the image src.

Okay I did find something will implement it! Thanks.

@jywarren
Copy link
Member

jywarren commented Jul 21, 2019 via email

@aashna27
Copy link
Author

aashna27 commented Jul 21, 2019 via email

@aashna27
Copy link
Author

@jywarren I have made the changes and tested it on all types of image sizes.
big-prev

cyan-prev

tulip-prev

@jywarren
Copy link
Member

Awesome!!!!

@jywarren jywarren merged commit 0db0943 into publiclab:main Jul 22, 2019
@jywarren
Copy link
Member

Super. We can merge to gh-pages soon!

@aashna27
Copy link
Author

Yeah many new features

jywarren pushed a commit that referenced this pull request Dec 16, 2019
* resize before loading previews

* min resize percentage calculated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Offer warning before generating preview "quick-add steps" on very large images
3 participants