No camera tricks here the Spanish fort of Peñon de Alhuceimas is really this close
This photo is taken from the beach of Asfiha, some kilometres east of Al-Hoceima. Except for the weird presence of the Spanish island just a few hundred metres off the coast (you could try to swim if you don't care the risk of entering foreign military territory), Asfiha beach is not recommended.
The sand is dark and sticky and even if you try to walk a hundred metres offshore it doesn't get any deeper than 1 metre. Perhaps you could walk to Spain?