forked from indymedia/epicyon
Deprecate metadata removal
parent
fb17065d46
commit
d6955968a1
25
media.py
25
media.py
|
@ -20,16 +20,21 @@ from shutil import rmtree
|
||||||
from shutil import move
|
from shutil import move
|
||||||
|
|
||||||
def removeMetaData(imageFilename: str,outputFilename: str) -> None:
|
def removeMetaData(imageFilename: str,outputFilename: str) -> None:
|
||||||
imageFile = open(imageFilename)
|
"""TODO At present metadata removal results in garbled images
|
||||||
image = Image.open(imageFilename)
|
so this is a simple copy for now
|
||||||
if not image:
|
"""
|
||||||
return
|
copyfile(imageFilename,outputFilename)
|
||||||
data = list(image.getdata())
|
return
|
||||||
if not data:
|
#imageFile = open(imageFilename)
|
||||||
return
|
#image = Image.open(imageFilename)
|
||||||
imageWithoutExif = Image.new(image.mode, image.size)
|
#if not image:
|
||||||
imageWithoutExif.putdata(data)
|
# return
|
||||||
imageWithoutExif.save(outputFilename)
|
#data = list(image.getdata())
|
||||||
|
#if not data:
|
||||||
|
# return
|
||||||
|
#imageWithoutExif = Image.new(image.mode, image.size)
|
||||||
|
#imageWithoutExif.putdata(data)
|
||||||
|
#imageWithoutExif.save(outputFilename)
|
||||||
|
|
||||||
def getImageHash(imageFilename: str) -> str:
|
def getImageHash(imageFilename: str) -> str:
|
||||||
return blurencode(numpy.array(Image.open(imageFilename).convert("RGB")))
|
return blurencode(numpy.array(Image.open(imageFilename).convert("RGB")))
|
||||||
|
|
Loading…
Reference in New Issue