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

Does not raise error when it has invalid thumbails data (#65) #66

Closed

Conversation

fabioperrella
Copy link
Contributor

fix #65

As I told you before, I don't have the permission, for now, to share the customer file, but I can show the test that I wrote here:

# tests/jpeg_test.rb
def test_jpeg_broken_thumbnails
  fname = f('broken_thumbnails.jpg')
  j = JPEG.new(fname)

  assert_equal j.exif.jpeg_thumbnails.size, 0
end

I don't know how to generate a file to reproduce that error or even a good way to mock/stub a file for this test (I noticed that there are no mocks in the tests, which I like!)

@fabioperrella
Copy link
Contributor Author

@fabioperrella
Copy link
Contributor Author

sorry @liamroth , I would like to cc @linkyndy , not you

@remvee
Copy link
Owner

remvee commented Sep 11, 2020

Thanks! 002b903

@fabioperrella
Copy link
Contributor Author

I'm not sure if you noticed, but the build in Circle CI seems to be broken for a while -> https://app.circleci.com/pipelines/github/remvee/exifr

julik pushed a commit to WeTransfer/format_parser that referenced this pull request Sep 11, 2020
Closes #157 

related to remvee/exifr#66

Before this update:
```bash
$ exe/format_parser_inspect broken_thumbnails.jpg
Traceback (most recent call last):
	30: from exe/format_parser_inspect:22:in `<main>'
	29: from exe/format_parser_inspect:22:in `map'
	28: from exe/format_parser_inspect:24:in `block in <main>'
	27: from exe/format_parser_inspect:24:in `public_send'
	26: from /Users/fabioperrella/projects/format_parser/lib/format_parser.rb:105:in `parse_file_at'
	25: from /Users/fabioperrella/projects/format_parser/lib/format_parser.rb:105:in `open'
	24: from /Users/fabioperrella/projects/format_parser/lib/format_parser.rb:106:in `block in parse_file_at'
	23: from /Users/fabioperrella/projects/format_parser/lib/format_parser.rb:174:in `parse'
...
```

After this update:
```bash
$ exe/format_parser_inspect broken_thumbnails.jpg
[
  {
    "source_path_or_url": "broken_thumbnails.jpg",
    "options": {
      "results": "first"
    },
    "result": {
      "nature": "image",
      "format": "jpg",
      "width_px": 1600,
      "height_px": 1200,
      "display_width_px": 1600,
      "display_height_px": 1200,
      "has_multiple_frames": null,
      "orientation": "top_left",
      "has_transparency": null,
      "color_mode": null,
...
```
@remvee
Copy link
Owner

remvee commented Sep 11, 2020 via email

@ferdnyc
Copy link

ferdnyc commented May 26, 2022

@remvee For how to do multiple versions of Ruby in GitHub Actions, see the README for ruby/setup-ruby, which includes a version matrix example.

@remvee
Copy link
Owner

remvee commented May 27, 2022

@ferdnyc thanks for the tip!

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.

Error when parsing Olympus microscope files
3 participants