Giphantie
Giphantie is a novel by Tiphaigne de la Roche published in 1760. The title is an anagram of the author's given name. A translated excerpt from the novel describes photography:
“Thou knowest that the rays of light, reflected from different bodies, make a picture and paint the bodies upon all polished surfaces, on the retina of the eye, for instance, on water, on glass. The elementary spirits have studied to fix these transient images: they have composed a most subtile matter, very viscous, and proper to harden and dry, by the help of which a picture is made in the twinkle of an eye. They do cover with this matter a piece of canvas, and hold it before the objects they have a mind to paint. The first effect of the canvas is that of a mirrour; there are seen upon it all the bodies far and near, whose image the light can transmit. But what the glass cannot do, the canvas, by means of the viscous matter, retains the images. The mirrour shows the objects exactly, but keeps none; our canvases show them with the same exactness, and retains them all. This impression of the images is made the first instant they are received on the canvas, which is immediately carried away into some dark place; an hour after, the subtile matter dries, and you have a picture so much the more valuable, as it cannot be imitated by art nor damaged by time.” (95-96, Gutenberg translation)

References

External links 
The complete work, in French
An English translation at Project Gutenberg

1760 novels
Precursors of photography
1760s fantasy novels