A method of providing synchronized optical image stabilization in a camera assembly having an adjustable lens, the method comprising: for an image sensor of the camera assembly with sensor elements disposed in rows oriented in a direction along a first axis and columns oriented in a direction along a second axis, obtaining information indicative of a beginning and a length of a frame period in which an image is captured by the image sensor using a rolling shutter, wherein each row of the frame comprises an exposure period followed by a readout period in which exposure values are read from the sensor elements of said row; and for each time of a plurality of times during the length of the frame period: obtaining (1420-a) respective movement data indicative of rotation around a third axis of the camera assembly corresponding to the respective time, wherein the third axis is orthogonal to the first axis and the second axis; determining (1420-b) a respective value of a time-dependent function based on the information indicative of the beginning and the length of the frame period, wherein the respective value of the time-dependent function is dependent on the respective time in relation to the length of the frame period, and wherein the determining of the respective value of the time-dependent function is synchronized with the image capture based on the information indicative of the beginning and the length of the frame period; and causing (1420-c) the adjustable lens to be moved in a direction along the first axis to a respective position relative to the image sensor during the length of the frame period, wherein the respective position is at least partially based on the respective movement data and the respective value of the time-dependent function. for an image sensor of the camera assembly with sensor elements disposed in rows oriented in a direction along a first axis and columns oriented in a direction along a second axis, obtaining information indicative of a beginning and a length of a frame period in which an image is captured by the image sensor using a rolling shutter, wherein each row of the frame comprises an exposure period followed by a readout period in which exposure values are read from the sensor elements of said row; and for each time of a plurality of times during the length of the frame period: obtaining (1420-a) respective movement data indicative of rotation around a third axis of the camera assembly corresponding to the respective time, wherein the third axis is orthogonal to the first axis and the second axis; determining (1420-b) a respective value of a time-dependent function based on the information indicative of the beginning and the length of the frame period, wherein the respective value of the time-dependent function is dependent on the respective time in relation to the length of the frame period, and wherein the determining of the respective value of the time-dependent function is synchronized with the image capture based on the information indicative of the beginning and the length of the frame period; and causing (1420-c) the adjustable lens to be moved in a direction along the first axis to a respective position relative to the image sensor during the length of the frame period, wherein the respective position is at least partially based on the respective movement data and the respective value of the time-dependent function. obtaining (1420-a) respective movement data indicative of rotation around a third axis of the camera assembly corresponding to the respective time, wherein the third axis is orthogonal to the first axis and the second axis; determining (1420-b) a respective value of a time-dependent function based on the information indicative of the beginning and the length of the frame period, wherein the respective value of the time-dependent function is dependent on the respective time in relation to the length of the frame period, and wherein the determining of the respective value of the time-dependent function is synchronized with the image capture based on the information indicative of the beginning and the length of the frame period; and causing (1420-c) the adjustable lens to be moved in a direction along the first axis to a respective position relative to the image sensor during the length of the frame period, wherein the respective position is at least partially based on the respective movement data and the respective value of the time-dependent function.