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

Support HEIC for previews #10526

Merged
merged 3 commits into from
Aug 22, 2018
Merged

Support HEIC for previews #10526

merged 3 commits into from
Aug 22, 2018

Conversation

steiny2k
Copy link
Contributor

@steiny2k steiny2k commented Aug 3, 2018

Adapt owncloud/core#30093 to NextCloud to tackle #7406

Testcase is developed, please review.

Signed-off-by: Sebastian Steinmetz <me@sebastiansteinmetz.ch>
Signed-off-by: Sebastian Steinmetz <me@sebastiansteinmetz.ch>
@steiny2k
Copy link
Contributor Author

Testcases are failing in CI environment, as ImageMagick probably doesn't handle HEIC format. If I run the test in my machine I see all green:

image

If possible, please update ImageMagick (I'm running 7.0.8-9) and compile it with config option --with-libheif. Make sure to have libde265 available so that it can find the necessary library. In macOS it's quite convenient using homebrew:
brew install --with-libheif imagemagick

@rullzer
Copy link
Member

rullzer commented Aug 16, 2018

Let me see what I can do here

@rullzer
Copy link
Member

rullzer commented Aug 16, 2018

Ah so updating the containers with a new imagick is not trivial... but top of that let me make some comments.

namespace OC\Preview;

class HEIC extends Bitmap {
/**
Copy link
Member

Choose a reason for hiding this comment

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

Should also override the isAvailable method. That can then check for support in imagemagick. Else this will do 💥 on system that do now have support for it.

class HEICTest extends Provider {

public function setUp() {
parent::setUp();
Copy link
Member

Choose a reason for hiding this comment

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

Since we also run CI on older systems. A check here would also be good. Then we can add imagick support in a newer version. And skip it here if the user running it has an unsupported versions.

@rullzer
Copy link
Member

rullzer commented Aug 16, 2018

@steiny2k sorry for having this around so long. Thnx for the PR :)

 - implement isAvailable
 - run tests only if ImageMagick with HEIC support is available in the
   environment

Signed-off-by: Sebastian Steinmetz <me@sebastiansteinmetz.ch>
@steiny2k
Copy link
Contributor Author

steiny2k commented Aug 17, 2018

Hi @rullzer, I think I've addressed your comments with the last input. Would you mind having another look?

One thing which came to my mind: would you prefer PNG or JPG previews? I think the nature of the majority of .heic files at the moment are photos rather than illustrations. So JPG is the better preview file format don't you think? If you agree so, I'd submit another commit to make JPG files.

@rullzer
Copy link
Member

rullzer commented Aug 22, 2018

@steiny2k sorry for having this around for a while.

yes I think JPG makes more sense indeed.

@steiny2k
Copy link
Contributor Author

steiny2k commented Aug 22, 2018

Hi @rullzer thanks, I've been looking into jpg over png, and would submit it tonight. However it would need to change the inheritance from Bitmap to the more generic Provider class, and copy&pasting some portions of the logic in Bitmap over. Or would you rather change the Bitmap class? It would basically mean to change the private functions getResizedPreview and resize to be protected so I can overwrite them?

Thanks for your input.

Also found an issue with the isAvailable check.

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

👍

@MorrisJobke MorrisJobke merged commit bb2336f into nextcloud:master Aug 22, 2018
@MorrisJobke
Copy link
Member

Oh - just have seen the update now ... Could you submit this as a separate PR then? :)

@MorrisJobke
Copy link
Member

Thanks for this nice contribution 👍

@MorrisJobke
Copy link
Member

If you are looking for other nice first tasks you can have a look at https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 :)

We are happy to help if you have questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants