attachment
attachment

Compare both

analyse_media
analyse_media
Browsing Directory

~/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12

Reading File
Reading File
Running Command

mkdir -p "/tmp/workspace/compare-bills" && python -c "from PIL import Image; p='/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12/IMG_3777.heic'; im=Image.open(p); im.save('/tmp/workspace/compare-bills/IMG_3777.jpg')"

I can read the JPG bill, but the HEIC file could not be opened, so I cannot compare both yet. Please re-upload the HEIC as a JPG, PNG, or a clear screenshot.
From the visible Paramount Medical Book Shop bill:
ItemListed rateCharged amount
Surgery Das, 2 volumes₹1,595₹2,100
Ophthalmology₹1,625₹1,140
Mudaliar₹1,495₹1,090
O.P. Khurana, 2 volumes₹1,595₹2,140
Hepatology?₹1,195₹1,540
Anatomy₹1,629₹1,100
Maheshwari, 2 volumes₹795₹1,160
Agappe?₹1,695₹1,185
  • Total of listed rates: ₹16,874
  • Total charged: ₹11,455
  • Difference / apparent discount: ₹5,419, about 32.1%
Some handwritten titles and quantities are unclear, and a few charged amounts appear higher than the single listed rate because they seem to include multiple volumes.
analyse_media
analyse_media
Browsing Directory

~/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12

Running Command

file "/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12/IMG_3777 (1).heic" "/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12/e516774a-8a7a-4392-9b9a-e359c9f2a78a (1).jpg" && ls -lh "/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12"

Running Command

which heif-convert || which convert || which magick || true

Running Command

mkdir -p "/tmp/workspace/compare-bills" && convert "/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12/IMG_3777 (1).heic[0]" "/tmp/workspace/compare-bills/IMG_3777_converted.jpg" && file "/tmp/workspace/compare-bills/IMG_3777_converted.jpg"

Reading File
Running Command

which tesseract && tesseract "/tmp/workspace/compare-bills/IMG_3777_converted.jpg" stdout 2>/dev/null

Running Command

python -m http.server 8765 --directory "/tmp/workspace/compare-bills" >/tmp/workspace/compare-bills/http.log 2>&1 &

analyse_media
Running Command

python -c "import importlib.util; print('easyocr', bool(importlib.util.find_spec('easyocr'))); print('paddleocr', bool(importlib.util.find_spec('paddleocr'))); print('keras_ocr', bool(importlib.util.find_spec('keras_ocr'))); print('cv2', bool(importlib.util.find_spec('cv2')))"

Running Command

pip install --user easyocr -q

Running Command

mkdir -p "/tmp/workspace/compare-bills/python" && pip install --target "/tmp/workspace/compare-bills/python" easyocr -q

Running Command

python - <<'PY' from PIL import Image import imagehash p1='/tmp/workspace/compare-bills/IMG_3777_converted.jpg' p2='/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12/e516774a-8a7a-4392-9b9a-e359c9f2a78a (1).jpg' a=Image.open(p1).convert('RGB'); b=Image.open(p2).convert('RGB') print('HEIC', a.size, 'JPG', b.size) for f in [imagehash.phash,imagehash.dhash,imagehash.average_hash]: print(f.__name__,f(a),f(b),'distance',f(a)-f(b)) # ImageMagick similarity after resizing PY compare -metric RMSE "/tmp/workspace/compare-bills/IMG_3777_converted.jpg" "/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12/e516774a-8a7a-4392-9b9a-e359c9f2a78a (1).jpg" null: 2>&1 || true

Running Command

python -c "import importlib.util; print([(x, bool(importlib.util.find_spec(x))) for x in ['pytesseract','transformers','torch','keras','rapidocr_onnxruntime','doctr','surya']])" && du -sh "/tmp/workspace/compare-bills"

Running Command

python - <<'PY' import cv2, numpy as np paths=['/tmp/workspace/compare-bills/IMG_3777_converted.jpg','/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12/e516774a-8a7a-4392-9b9a-e359c9f2a78a (1).jpg'] for p in paths: x=cv2.imread(p,0); x=cv2.resize(x,(32,32)); d=cv2.dct(np.float32(x)); h=d[:8,:8]; bits=h>np.median(h); print(p, bits.astype(int).ravel().tolist(), 'mean',x.mean()) a=[] for p in paths: x=cv2.imread(p,0); x=cv2.resize(x,(32,32)); d=cv2.dct(np.float32(x)); h=d[:8,:8]; a.append(h>np.median(h)) print('hamming',np.count_nonzero(a[0]!=a[1]),'/64') PY

Running Command

sha256sum "/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12/e516774a-8a7a-4392-9b9a-e359c9f2a78a.jpg" "/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12/e516774a-8a7a-4392-9b9a-e359c9f2a78a (1).jpg" "/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12/IMG_3777.heic" "/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12/IMG_3777 (1).heic" && python - <<'PY' from PIL import Image for p in ['/tmp/workspace/compare-bills/IMG_3777_converted.jpg','/tmp/workspace/attachments/dd2d38d0-696e-4f7b-be26-f861f197ce12/e516774a-8a7a-4392-9b9a-e359c9f2a78a (1).jpg']: im=Image.open(p); print(p, im.size) PY

The re-upload contains the same two original files again. I confirmed the duplicate JPGs are byte-for-byte identical, and so are the duplicate HEICs.
I was able to convert the HEIC successfully, but its contents still cannot be reliably extracted in this chat. Please open the converted file below to verify it, or upload it as a screenshot/JPG so I can make a line-by-line comparison:

IMG 3777 converted

Image · JPG

From the visible JPG bill:
  • Printed total: ₹16,874
  • Amount charged: ₹11,455
  • Difference: ₹5,419
  • Effective overall discount: 32.1%
Once you send the HEIC as a normal JPG/PNG screenshot, I will compare each book, quantity, MRP, discount, and final total.
This is a shared conversation. Sign in to Orris to start your own chat.