OpenOversight icon indicating copy to clipboard operation
OpenOversight copied to clipboard

converts bad photo file extensions (supercedes 404/412)

Open ssempervirens opened this issue 5 years ago • 2 comments

Resolves #369 and supercedes PRs #404 and #412. I made a real mess of this issue, and I figured a new branch is the cleanest fix since that was a while ago.

Status

WIP

Description of Changes

Fixes # 369.

Changes proposed in this pull request:

  • Convert psd and tiff files to jpeg
  • Test that tiff and psd files can be uploaded
  • Note: avoided using os.open, I don't believe this is necessary and avoids dealing with safety warnings

Notes for Deployment

Screenshots (if appropriate)

Tests and linting

  • [x] I have rebased my changes on current develop

  • [ ] pytests pass in the development environment on my local machine Note: I get 'TypeError: attrib() got an unexpected keyword argument 'convert' when I make test. This seems to be an issue with the package attrs rather than anything I changed, but please let me know if this is not correct.

  • [ ] flake8 checks pass

ssempervirens avatar Oct 15 '19 22:10 ssempervirens

Hey @ssempervirens, I'm following up about the error message you got, TypeError: attrib() got an unexpected keyword argument 'convert' , after you ran make test. I didn't hit this error when I ran the tests on my own machine, but I did see it in the Travis build for another PR. I read up on stackoverflow and realized that the error was caused by OO using an older version of pytest, 4.0.2. (I had a more recent version of pytest installed on my local machine, and I think that's why I didn't get this error locally.)

I updated pytest to 5.2.2 in dev-requirements.txt and it fixed the error for me. Let me know if this fixes the error for you, too.

Also, since this PR is superseding #412, could you please close #412? (I checked and saw that you already closed #404.) Thanks!

McEileen avatar Oct 27 '19 22:10 McEileen

For what it's worth, I'm seeing the same thing as @McEileen. Namely, I was getting TypeError: attrib() got an unexpected keyword argument 'convert', when I ran make test on @ssempervirens' 369-convert-photo-extension branch. However, when I rebased this branch onto the current develop, which contains @McEileen's patch bumping the pytest version, it worked.

I think if we ran this through Travis CI again, the tests would probably pass.

brianmwaters avatar Dec 27 '19 19:12 brianmwaters