CLI icon indicating copy to clipboard operation
CLI copied to clipboard

Changed mime library to mime ^3.0.0 and add custom mimes for raw images

Open tetofonta opened this issue 2 years ago • 2 comments

Given https://github.com/immich-app/CLI/issues/47, the problem relied on in the fact that mime-types does not recognize raw photo formats (.nef for Nikon, probably more of them for other brands) and so those won't be uploaded.

My solution is to migrate from mime-types to mime to be able to use the ability to define custom mime types. Because of that, all the non-default types are placed in an object associating their file extensions.

tetofonta avatar Apr 05 '23 20:04 tetofonta

Thanks for the PR! A few thoughts:

  • We're looking to move all the mimetype checks and such to the server (#27), so I'm not too keen to add more edge cases here.
  • I think we should be careful about using a different mimetype lib in the CLI vs in the server
  • That --regex flag should at least be a separate PR
  • I think instead of filtering like --regex built in to the CLI, a better option would be something like --files-from-stdin, so the CLI can be used with standard linux utilities: find . -name "FOO_*" | immich --files-from-stdin

@alextran1502 want to make sure you see this, I think you don't get pings for new CLI PRs.

bo0tzz avatar Apr 07 '23 11:04 bo0tzz

Just gonna note here and say that this PR successfully uploaded all my NEF photos but it seems that they aren't being properly rendered by immich (very low res jpg is shown) even on the latest immich update, so it seems there has to be more done on immich's side.

ClumsyAdmin avatar Jun 25 '23 15:06 ClumsyAdmin