Illustrator exports size of whole JPEG rather than its clipping mask
I am opening my JPEG putting a shape on top and then creating a clipping mask. This works great and I end up with what I want, however my JPEG is still there in the background and the outlines still remain, meaning when I go to export it is exporting the size of the original JPEG as opposed to the clipping mask. if I hide the JPEG in the layers panel the colour in the clipping mask disappears.
That is all working as expected and is how things should work. Your image will always still be behind the clipping mask, thats how a clipping mask worksâ€”it masks the image, rather than destructively cropping it.
The problem is therefor how you are exporting your artwork. However you export your artwork there are basically two options, export everything or export your artboard[s].
Using Export, simply check "Use Artboards":
Using Save for Web, check "Clip to Artboard":
(Note, screenshots etc are from Illustrator CS6, things may look different in newer versions.)
If your artboard is not the same size as the artwork you want to export then select your image or clipping mask or whatever you want to export and go to Object â†’ Artboards â†’ Fit to Selected Art, which will fit the artboard to the selected object. You can then export at the correct size.