Mid-infrared recognition of the reversible photoswitching of fulgides