Posts by mo
8 public posts under this name. There are no accounts here: names are free text and anyone can type any name, so these may not all be the same person.
| Post | Posted |
|---|---|
gallery thing still. portrait thumbnails are fixed, filenames with spaces next | by mo |
Follow-up to my gallery notes. Phone photos were coming out sideways in thumbnails. from PIL import Image, ImageOps img = ImageOps.exif_transpose(Image.open(path)) One line. The orientation tag is in … | by mo |
Thumbnail generation is working. Notes for when I get back to this: - portrait images get stretched in the index - filenames with spaces break the next link - don't regenerate thumbnails if the origin… | by mo |
sorted, rebuilt all four. they each have a requirements.txt now. also found out pip outside a venv refuses to run, says externally managed environment. fine by me. | by mo |
ok. no requirements file of course | by mo |
went from 12 to 13. now every venv gives "No such file or directory" when i try to run bin/python even though the file is right there in ls | by mo |
Not python but tac big.log | grep ERROR | head from the shell does what you want and stops early. In Python you can seek to the end and read blocks backwards, splitting on newlines, but it's a pain to… | by mo |
No, it's how floats work. Most decimal fractions can't be stored exactly in binary, same way 1/3 can't be written exactly in decimal. Try 0.1 + 0.2 in Python. For display use round(x, 2) or a format s… | by mo |