def __init__(self, conf, photoname, album):
        # Parameters storage
        self.conf = conf
        self.originalname = photoname
        self.originalpath = album['path']
        self.albumid = album['id']
        self.albumname = album['name']

        # if star in file name, photo is starred
        if ('star' in self.originalname) or (self.originalname in 'cover'):
            self.star = 1

        # Compute Photo ID
        self.id = str(int(time.time()))
        # not precise enough
        length = len(self.id)
        if length < 14:
            missing_char = 14 - length
            r = random.random()
            r = str(r)
            # last missing_char char
            filler = r[-missing_char:]
            self.id = self.id + filler

        assert len(self.id) == 14, "id {} is not 14 character long: {}".format(self.id, str(len(self.id)))

        # Compute file storage url
        m = hashlib.md5()
        m.update(self.id.encode('utf-8'))
        crypted = m.hexdigest()

        ext = os.path.splitext(photoname)[1]
        self.url = ''.join([crypted, ext]).lower()
        self.thumbUrl = self.url

        # src and dest fullpath
        self.srcfullpath = os.path.join(self.originalpath, self.originalname)
        self.destfullpath = os.path.join(self.conf["lycheepath"], "uploads", "big", self.url)

        # Generate file checksum
        self.__generateHash()

        # thumbnails already in place (see makeThumbnail)

        # Auto file some properties
        self.type = mimetypes.guess_type(self.originalname, False)[0]
        self.size = os.path.getsize(self.srcfullpath)
        self.size = str(self.size / 1024) + " KB"
        # Default date
        takedate = datetime.date.today().isoformat()
        taketime = datetime.datetime.now().strftime('%H:%M:%S')
        self._str_datetime = takedate + " " + taketime

        # Exif Data Parsing
        self.exif = ExifData()
        try:

            img = Image.open(self.srcfullpath)
            w, h = img.size
            self.width = float(w)
            self.height = float(h)

            if hasattr(img, '_getexif'):
                try:
                    exifinfo = img._getexif()
                except Exception as e:
                    exifinfo = None
                    logger.warn('Could not obtain exif info for image: %s', e)
                # exifinfo = img.info['exif']
                # logger.debug(exifinfo)
                if exifinfo is not None:
                    for tag, value in exifinfo.items():
                        decode = TAGS.get(tag, tag)
                        if decode == "Orientation":
                            self.exif.orientation = value
                        if decode == "Make":
                            self.exif.make = value
                        if decode == "MaxApertureValue":
                            aperture = math.sqrt(2) ** value[0]
                            try:
                                aperture = decimal.Decimal(aperture).quantize(
                                    decimal.Decimal('.1'),
                                    rounding=decimal.ROUND_05UP)
                            except Exception as e:
                                logger.debug("aperture only a few digit after comma: {}".format(aperture))
                                logger.debug(e)
                            self.exif.aperture = aperture
                        if decode == "FocalLength":
                            self.exif.focal = value[0]
                        if decode == "ISOSpeedRatings":
                            self.exif.iso = value[0]
                        if decode == "Model":
                            self.exif.model = value
                        if decode == "ExposureTime":
                            self.exif.exposure = value[0]
                        if decode == "ShutterSpeedValue":
                            s = value[0]
                            s = 2 ** s
                            s = decimal.Decimal(s).quantize(decimal.Decimal('1'), rounding=decimal.ROUND_05UP)
                            if s <= 1:
                                s = decimal.Decimal(
                                    1 /
                                    float(s)).quantize(
                                    decimal.Decimal('0.1'),
                                    rounding=decimal.ROUND_05UP)
                            else:
                                s = "1/" + str(s)
                            self.exif.shutter = str(s) + " s"

                        if decode == "DateTimeOriginal":
                            try:
                                self.exif.takedate = value[0].split(" ")[0]
                            except Exception as e:
                                logger.warn('invalid takedate: ' + str(value) + ' for ' + self.srcfullpath)

                        if decode == "DateTimeOriginal":
                            try:
                                self.exif.taketime = value[0].split(" ")[1]
                            except Exception as e:
                                logger.warn('invalid taketime: ' + str(value) + ' for ' + self.srcfullpath)

                        if decode == "DateTime" and self.exif.takedate is None:
                            try:
                                self.exif.takedate = value.split(" ")[0]
                            except Exception as e:
                                logger.warn('DT invalid takedate: ' + str(value) + ' for ' + self.srcfullpath)

                        if decode == "DateTime" and self.exif.taketime is None:
                            try:
                                self.exif.taketime = value.split(" ")[1]
                            except Exception as e:
                                logger.warn('DT invalid taketime: ' + str(value) + ' for ' + self.srcfullpath)

                    # compute shutter speed

                    if not(self.exif.shutter) and self.exif.exposure:
                        if self.exif.exposure < 1:
                            e = str(Fraction(self.exif.exposure).limit_denominator())
                        else:
                            e = decimal.Decimal(
                                self.exif.exposure).quantize(
                                decimal.Decimal('0.01'),
                                rounding=decimal.ROUND_05UP)
                        self.exif.shutter = e

                    if self.exif.shutter:
                        self.exif.shutter = str(self.exif.shutter) + " s"
                    else:
                        self.exif.shutter = ""

                    if self.exif.exposure:
                        self.exif.exposure = str(self.exif.exposure) + " s"
                    else:
                        self.exif.exposure = ""

                    if self.exif.focal:
                        self.exif.focal = str(self.exif.focal) + " mm"
                    else:
                        self.exif.focal = ""

                    if self.exif.aperture:
                        self.exif.aperture = 'F' + str(self.exif.aperture)
                    else:
                        self.exif.aperture = ""

                    # compute takedate / taketime
                    if self.exif.takedate:
                        takedate = self.exif.takedate.replace(':', '-')
                        taketime = '00:00:00'

                    if self.exif.taketime:
                        taketime = self.exif.taketime

                    # add mesurement units

                    self._str_datetime = takedate + " " + taketime

                    self.description = self._str_datetime

        except IOError as e:
            logger.debug('ioerror (corrupted ?): ' + self.srcfullpath)
            raise e
dataset/ETHPy150Open GustavePate/lycheesync/lycheesync/lycheemodel.py/LycheePhoto.__init__/swapped operands of `in`