We demonstrate quantitative magnetic field mapping with nanoscale resolution, by applying a lock-in technique on the electron spin resonance frequency of a single nitrogen-vacancy (NV) defect placed at the apex of an atomic force microscope tip. To illustrate the efficiency of the technique, we image a commercial magnetic hard disk and observe good agreement with the simulated magnetic field distributions. In addition, we report a novel all-optical magnetic imaging technique which is sensitive to large off-axis magnetic fields, thus extending the operation range of diamond-based magnetometry. It relies on magnetic-field-dependent photoluminescence of the NV defect magnetic probe, induced by spin level mixing. This method allows us to directly resolve the nanoscale magnetic bit structure of the hard disk. Owing to the non-perturbing and quantitative nature of the magnetic probe, this work should open up numerous perspectives in nanomagnetism and spintronics.