It's not the official flag, that would be the 'senyera', consisting only on the red and yellow bars without the blue triangle and the star. The one depicted here is called 'estelada' and was invented in the early 20th century to represent the separatist movement. There are alternative versions, like the used by leftists groups with a red star over a yellow triangle. You can read more about it here: https://en.wikipedia.org/wiki/Estelada
PS: for some reason I couldn't directly reply to kalbahamut comment.