Skip to content

The bitmap preview class now takes maxX and maxY into consideration - #13635

Closed
oparoz wants to merge 1 commit into
owncloud:masterfrom
oparoz:limit-bitmap-previews
Closed

oparoz wants to merge 1 commit into
owncloud:masterfrom
oparoz:limit-bitmap-previews

Conversation

@oparoz

@oparoz oparoz commented Jan 23, 2015

Copy link
Copy Markdown
Contributor

This is a fix for #13607
and is part of the global programme to fix preview caching: #13609

  • Original TIFF: 140MB. Waiting an insane amount of time every time you need a preview because a conversion is asked every time
  • With Introducing the maximum size preview #13674: Preview only resizes a 48MB file. Waiting about a minute for each preview
  • Combined with this: Preview only resizes a 6.7MB file. Waiting about 3 SECONDS.

@MorrisJobke MorrisJobke modified the milestones: 8.0-current, 8.1-next Jan 24, 2015
@oparoz oparoz self-assigned this Jan 26, 2015
@LukasReschke LukasReschke changed the title The bitmap preview class now takes maxX and maxY into consideration [WIP] The bitmap preview class now takes maxX and maxY into consideration Feb 24, 2015
@oparoz oparoz changed the title [WIP] The bitmap preview class now takes maxX and maxY into consideration The bitmap preview class now takes maxX and maxY into consideration Feb 24, 2015
@oparoz

oparoz commented Mar 6, 2015

Copy link
Copy Markdown
Contributor Author

The idea behind a "max" preview is to have the same image, including aspect ratio, that fits into max dimensions, so I've removed the "fill" action.
A "fill" option could be implemented at a later stage when and if the interface changes and if it is deemed useful to received images which are of a predefined dimension such as 200x200

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@DeepDiver1975 @LukasReschke Can we rely on this? is this a hard dependency already?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@MorrisJobke

Copy link
Copy Markdown
Contributor

@MorrisJobke

Copy link
Copy Markdown
Contributor

@MorrisJobke

Copy link
Copy Markdown
Contributor

code looks good

@MorrisJobke

Copy link
Copy Markdown
Contributor

@nickvergessen @georgehrke Interested in reviewing?

Comment thread lib/private/preview/bitmap.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No space before :, we are not french ;)

@MorrisJobke

Copy link
Copy Markdown
Contributor

@owncloud-bot retest this please

@MorrisJobke

Copy link
Copy Markdown
Contributor
00:15:07.970 1) OC\Core\Avatar\AvatarControllerTest::testPostAvatarFile
00:15:07.973 file_put_contents(/dev/shm/data-autotest5/eiyadirgdeao/cache/avatar_upload): failed to open stream: No such file or directory
00:15:07.973 
00:15:07.973 /var/jenkins/workspace/pull-request-analyser-ng-simple@2/label/SLAVE/lib/private/files/storage/local.php:165
00:15:07.973 /var/jenkins/workspace/pull-request-analyser-ng-simple@2/label/SLAVE/lib/private/files/view.php:956
00:15:07.973 /var/jenkins/workspace/pull-request-analyser-ng-simple@2/label/SLAVE/lib/private/files/view.php:517
00:15:07.973 /var/jenkins/workspace/pull-request-analyser-ng-simple@2/label/SLAVE/tests/core/avatar/avatarcontrollertest.php:248
00:15:07.973 
00:15:07.973 2) OC\Core\Avatar\AvatarControllerTest::testPostAvatarFileGif
00:15:07.973 file_put_contents(/dev/shm/data-autotest5/fkdxltjwmwhj/cache/avatar_upload): failed to open stream: No such file or directory
00:15:07.973 
00:15:07.973 /var/jenkins/workspace/pull-request-analyser-ng-simple@2/label/SLAVE/lib/private/files/storage/local.php:165
00:15:07.973 /var/jenkins/workspace/pull-request-analyser-ng-simple@2/label/SLAVE/lib/private/files/view.php:956
00:15:07.973 /var/jenkins/workspace/pull-request-analyser-ng-simple@2/label/SLAVE/lib/private/files/view.php:517
00:15:07.973 /var/jenkins/workspace/pull-request-analyser-ng-simple@2/label/SLAVE/tests/core/avatar/avatarcontrollertest.php:288

@oparoz

oparoz commented Mar 11, 2015

Copy link
Copy Markdown
Contributor Author

@MorrisJobke - This is unrelated to this PR afaik

@MorrisJobke

Copy link
Copy Markdown
Contributor

@oparoz But it fails just on this branch ;)

@nickvergessen

Copy link
Copy Markdown
Contributor

Nop #14813

@MorrisJobke

Copy link
Copy Markdown
Contributor

I know.

Comment thread lib/private/preview/bitmap.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pass this to getResizedPreview instead of saving it in the class.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is there a particular reason? I originally had 3 private methods, all needing that information and I didn't want to have to make the variables traverse each method.
Now with 2, it's less of a hassle, but I'm wondering what the issue is with leaving it as is.

EDIT: If it's to improve readability (currently the resize method has no size arguments), then I fully understand.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The max dimensions is not part of the preview provider but determined by thr getThumbnail call, thus they should not be part of the state of the provider

This is a fix for #13607 and is part of the global programme: #13609

The image aspect ratio is kept intact.
@scrutinizer-notifier

Copy link
Copy Markdown

A new inspection was created.

@oparoz

oparoz commented Mar 31, 2015

Copy link
Copy Markdown
Contributor Author

Had forgotten to rebase...

@oparoz

oparoz commented Apr 1, 2015

Copy link
Copy Markdown
Contributor Author

Weird... the "Passed" test result went away...
The same PR here #15349 was OK.
Should I just forget this one and restore the other one?

@oparoz

oparoz commented Apr 1, 2015

Copy link
Copy Markdown
Contributor Author

Moved to #15349

@oparoz oparoz closed this Apr 1, 2015
@MorrisJobke MorrisJobke removed this from the 8.1-current milestone Apr 1, 2015
@oparoz
oparoz deleted the limit-bitmap-previews branch April 1, 2015 13:20
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants