Repository: jmathai/elodie

Issue #379: Elodie crashes when non-ASCII character in filename.
Created: 2020-07-07T16:32:52Z
I have folders with polish characters in name. When Elodie runs into them, I get this error:
Traceback (most recent call last):
  File "elodie.py", line 378, in <module>
    main()
  File "P:\Python\Python37-32\lib\site-packages\click\core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "P:\Python\Python37-32\lib\site-packages\click\core.py", line 696, in main
    rv = self.invoke(ctx)
  File "P:\Python\Python37-32\lib\site-packages\click\core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "P:\Python\Python37-32\lib\site-packages\click\core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "P:\Python\Python37-32\lib\site-packages\click\core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "elodie.py", line 141, in _import
    trash, allow_duplicates)
  File "elodie.py", line 68, in import_file
    media, allowDuplicate=allow_duplicates, move=False)
  File "c:\Users\Filip\Desktop\elodie-master\elodie\filesystem.py", line 525, in process_file
    metadata = media.get_metadata()
  File "c:\Users\Filip\Desktop\elodie-master\elodie\media\base.py", line 93, in get_metadata
    'date_taken': self.get_date_taken(),
  File "c:\Users\Filip\Desktop\elodie-master\elodie\media\photo.py", line 61, in get_date_taken
    exif = self.get_exiftool_attributes()
  File "c:\Users\Filip\Desktop\elodie-master\elodie\media\media.py", line 128, in get_exiftool_attributes
    self.exif_metadata = ExifTool().get_metadata(source)
  File "c:\Users\Filip\Desktop\elodie-master\elodie\external\pyexiftool.py", line 340, in get_metadata
    return self.execute_json(filename)[0]
  File "c:\Users\Filip\Desktop\elodie-master\elodie\external\pyexiftool.py", line 322, in execute_json
    return json.loads(self.execute(b"-j", *params).decode("utf-8"))
  File "P:\Python\Python37-32\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "P:\Python\Python37-32\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "P:\Python\Python37-32\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Duplicate issue #396: Traceback Error
Created: 2020-12-31T15:14:44Z
Hello,
I'm running into a traceback error and I can't figure out why. Does Elodie have a character limit? I check the path length and it has 96 characters.
This is the command I ran:
PS C:\Users\aleja> C:\tools\elodie\elodie.py import --debug --destination="D:\Pictures\Unorganized\Shared Albums" "D:\Pictures\iCloud Downloads\Shared Albums"
This is the error I get after 1-3 pictures:
D:\Pictures\iCloud Downloads\Shared Albums\Family\01bd2e74f42b70163e89aba4a110be2d256fb63fc8.jpg -> D:\Pictures\Unorganized\Shared Albums\2020-02-Feb\Cedar Park\2020-02-23_15-51-49-01bd2e74f42b70163e89aba4a110be2d256fb63fc8.jpg
D:\Pictures\iCloud Downloads\Shared Albums\Family\013a1bb9233171b64506219e2c8e78fa0e39fb8b5b.jpg -> D:\Pictures\Unorganized\Shared Albums\2020-05-May\Cedar Park\2020-05-09_23-35-00-013a1bb9233171b64506219e2c8e78fa0e39fb8b5b.jpg
Traceback (most recent call last):
  File "C:\tools\elodie\elodie.py", line 378, in <module>
    main()
  File "C:\Program Files\Python37\lib\site-packages\click\core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "C:\Program Files\Python37\lib\site-packages\click\core.py", line 696, in main
    rv = self.invoke(ctx)
  File "C:\Program Files\Python37\lib\site-packages\click\core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Program Files\Python37\lib\site-packages\click\core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Program Files\Python37\lib\site-packages\click\core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "C:\tools\elodie\elodie.py", line 141, in _import
    trash, allow_duplicates)
  File "C:\tools\elodie\elodie.py", line 68, in import_file
    media, allowDuplicate=allow_duplicates, move=False)
  File "C:\tools\elodie\elodie\filesystem.py", line 524, in process_file
    metadata = media.get_metadata()
  File "C:\tools\elodie\elodie\media\base.py", line 93, in get_metadata
    'date_taken': self.get_date_taken(),
  File "C:\tools\elodie\elodie\media\photo.py", line 61, in get_date_taken
    exif = self.get_exiftool_attributes()
  File "C:\tools\elodie\elodie\media\media.py", line 128, in get_exiftool_attributes
    self.exif_metadata = ExifTool().get_metadata(source)
  File "C:\tools\elodie\elodie\external\pyexiftool.py", line 340, in get_metadata
    return self.execute_json(filename)[0]
  File "C:\tools\elodie\elodie\external\pyexiftool.py", line 322, in execute_json
    return json.loads(self.execute(b"-j", *params).decode("utf-8"))
  File "C:\Program Files\Python37\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\Python37\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\Python37\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Closing comment (2021-01-02T14:54:58Z): Sad news, happened on a JPG file as well. Here is the output of exiftool
PS Z:\scripts\python> exiftool "D:\Pictures\Elodie Test\Shared Albums\Booba’s\0129145488adc57d1fc20d6427784409de207b904a.jpg"
ExifTool Version Number         : 12.08
File Name                       : 0129145488adc57d1fc20d6427784409de207b904a.jpg
Directory                       : D:/Pictures/Elodie Test/Shared Albums/BoobaÆs
Warning                         : FileName encoding not specified
File Size                       : 619 kB
File Modification Date/Time     : 2020:12:29 16:52:39-06:00
File Access Date/Time           : 2021:01:02 08:48:31-06:00
File Creation Date/Time         : 2021:01:02 08:45:05-06:00
File Permissions                : rw-rw-rw-
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Make                            : Apple
Camera Model Name               : iPhone 11 Pro Max
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : 13.5.1
Modify Date                     : 2020:06:28 15:06:39
Y Cb Cr Positioning             : Centered
Exposure Time                   : 1/331
F Number                        : 2.0
Exposure Program                : Program AE
ISO                             : 20
Exif Version                    : 0221
Date/Time Original              : 2020:06:28 15:06:39
Create Date                     : 2020:06:28 15:06:39
Offset Time                     : -05:00
Offset Time Original            : -05:00
Offset Time Digitized           : -05:00
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/331
Aperture Value                  : 2.0
Brightness Value                : 8.472380859
Exposure Compensation           : 0
Metering Mode                   : Multi-segment
Flash                           : Auto, Did not fire
Focal Length                    : 6.0 mm
Subject Area                    : 1407 1707 374 358
Run Time Flags                  : Valid
Run Time Value                  : 153200738808416
Run Time Epoch                  : 0
Run Time Scale                  : 1000000000
Acceleration Vector             : 0.01563851162 -0.97876525 -0.1517325192
Sub Sec Time Original           : 586
Sub Sec Time Digitized          : 586
Flashpix Version                : 0100
Color Space                     : Uncalibrated
Exif Image Width                : 1536
Exif Image Height               : 2048
Sensing Method                  : One-chip color area
Scene Type                      : Directly photographed
Custom Rendered                 : Portrait HDR
Exposure Mode                   : Auto
White Balance                   : Auto
Focal Length In 35mm Format     : 52 mm
Scene Capture Type              : Standard
Lens Info                       : 4.25-6mm f/1.8-2
Lens Make                       : Apple
Lens Model                      : iPhone 11 Pro Max back dual camera 6mm f/2
Composite Image                 : General Composite Image
GPS Latitude Ref                : removed
GPS Longitude Ref               : removed
GPS Altitude Ref                : removed
GPS Speed Ref                   : removed
GPS Speed                       :  removed
GPS Img Direction Ref           : removed
GPS Img Direction               : removed
GPS Dest Bearing Ref            : removed
GPS Dest Bearing                : removed
GPS Horizontal Positioning Error: 4.819925711 m
Compression                     : JPEG (old-style)
Thumbnail Offset                : 2372
Thumbnail Length                : 7901
XMP Toolkit                     : XMP Core 5.4.0
Region Area Y                   : 0.4429047703742981, 0.43452382087707525, 0.45849999785423279
Region Area W                   : 0.11400000005960464, 0.12700000405311584, 0.12099999934434891
Region Area X                   : 0.54199999570846558, 0.45249998569488525, 0.43650001287460327
Region Area H                   : 0.08485714346170431, 0.09533333033323288, 0.086999997496604864
Region Area Unit                : normalized, normalized, normalized
Region Type                     : Face, Face, Focus
Region Extensions Angle Info Yaw: 45
Region Extensions Angle Info Roll: 330
Region Extensions Confidence Level: 491
Region Extensions Face ID       : 49
Region Extensions               :
Region Applied To Dimensions H  : 4032
Region Applied To Dimensions W  : 3023
Region Applied To Dimensions Unit: pixel
Profile CMM Type                : Apple Computer Inc.
Profile Version                 : 4.0.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 2017:07:07 13:22:32
Profile File Signature          : acsp
Primary Platform                : Apple Computer Inc.
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : Apple Computer Inc.
Device Model                    :
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : Apple Computer Inc.
Profile ID                      : ca1a9582257f104d389913d5d1ea1582
Profile Description             : Display P3
Profile Copyright               : Copyright Apple Inc., 2017
Media White Point               : 0.95045 1 1.08905
Red Matrix Column               : 0.51512 0.2412 -0.00105
Green Matrix Column             : 0.29198 0.69225 0.04189
Blue Matrix Column              : 0.1571 0.06657 0.78407
Red Tone Reproduction Curve     : (Binary data 32 bytes, use -b option to extract)
Chromatic Adaptation            : 1.04788 0.02292 -0.0502 0.02959 0.99048 -0.01706 -0.00923 0.01508 0.75168
Blue Tone Reproduction Curve    : (Binary data 32 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 32 bytes, use -b option to extract)
Image Width                     : 1536
Image Height                    : 2048
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Run Time Since Power Up         : 1 days 18:33:21
Aperture                        : 2.0
Image Size                      : 1536x2048
Lens ID                         : iPhone 11 Pro Max back dual camera 6mm f/2
Megapixels                      : 3.1
Scale Factor To 35 mm Equivalent: 8.7
Shutter Speed                   : 1/331
Create Date                     : 2020:06:28 15:06:39.586-05:00
Date/Time Original              : 2020:06:28 15:06:39.586-05:00
Modify Date                     : 2020:06:28 15:06:39-05:00
Thumbnail Image                 : (Binary data 7901 bytes, use -b option to extract)
GPS Altitude                    : 436 m Above Sea Level
GPS Latitude                    : removed
GPS Longitude                   : removed
Circle Of Confusion             : 0.003 mm
Field Of View                   : 38.2 deg
Focal Length                    : 6.0 mm (35 mm equivalent: 52.0 mm)
GPS Position                    : removed
Hyperfocal Distance             : 5.19 m
Light Value                     : 12.7
However, I noticed something interesting in exiftool output:
Directory                       : D:/Pictures/Elodie Test/Shared Albums/**BoobaÆs**
So I removed the special character and placed all the videos back where they go and voila! So I guess this is a duplicate of #379