I don't think scanning a library book, or a book borrowed from a friend, for personal use, is breaking the law in any country.
Also, while what you did was possibly illegal you're not a criminal. People could sue you for loss of earnings, but the police (and fines and criminal records) only get involved if you are selling what you're copying.
"Format shifting" tends to be not legal but ignored by everyone. In the UK for at shifting is changing status from not legal to legal. "Time shifting" was written i to law as being allowed because otherwise VCRs would have been ridiculous.