In this paper we present a new tool for automatic, blind surface photometry of galaxies in deep and/or wide fields. The tool (GASPHOT) favors the robustness of results with respect to the details of galaxy modeling. To this aim, a single Sersic-law for the models and a hybrid 1D/2D approach for the best-fitting algorithm were adopted. GASPHOT is heavily based on SExtractor and provides luminosity, position angle and ellipticity profiles of galaxies extracted from CCD frames, as well as total magnitudes, half-light radii, and Sersic indices. These global parameters were obtained by simultaneously fitting the major and minor axis light growth curves of galaxies with a 2D flattened Sersiclaw, convolved by the appropriate, space-varying PSF, which was previously evaluated by the tool itself. We tested GASPHOT on more than 15 000 simulated and real galaxies, obtaining robust upper limits for the errors of the global parameters of galaxies, even for non-Sersic profiles and blended objects. The GASPHOT performance was also compared with those of two popular alternative tools for a single component, Sersic law: GALFIT (Peng et al. 2002) and GIM2D (Marleau &Simard 1998). When dealing with ideal, isolated, and adeguately large galaxies, the three packages were all found to provide satisfactory results, apart from a definite bias in the GIM2D magnitudes. On the other hand, GASPHOT proved to be more robust than GALFIT and GIM2D for simulated, blended objects and for real galaxies. Moreover, at variance with GASPHOT and GALFIT, the quality (bias and scatter) of the fits provided by GIM2D rapidly declines as the galaxy size decreases.