docs: private boolean updateTrgPic(int index) {
  		SubPicture picSrc = subtitleStream.getSubPicture(index);
  		SubPicture picTrg = subPictures[index];
  		double scaleX = (double) picTrg.getWidth() / picSrc.getWidth();
  		double scaleY = (double) picTrg.getHeight() / picSrc.getHeight();
  		double fx;
  		double fy;
  		if (configuration.getApplyFreeScale()) {
  			fx = configuration.getFreeScaleFactorX();
  			fy = configuration.getFreeScaleFactorY();
  		} else {
  			fx = 1.0;
  			fy = 1.0;
  		}
  
  		int wOld = picTrg.getImageWidth();
  		int hOld = picTrg.getImageHeight();
  		int wNew = (int) (picSrc.getImageWidth() * scaleX * fx + 0.5);
  		if (wNew < MIN_IMAGE_DIMENSION) {
  			wNew = picSrc.getImageWidth();
  		} else if (wNew > picTrg.getWidth()) {
  			wNew = picTrg.getWidth();
  		}
  		int hNew = (int) (picSrc.getImageHeight() * scaleY * fy + 0.5);
  		if (hNew < MIN_IMAGE_DIMENSION) {
  			hNew = picSrc.getImageHeight();
  		} else if (hNew > picTrg.getHeight()) {
  			hNew = picTrg.getHeight();
  		}
  		picTrg.setImageWidth(wNew);
  		picTrg.setImageHeight(hNew);
  		if (wNew != wOld) {
  			int xOfs = (int) (picSrc.getXOffset() * scaleX + 0.5);
  			int spaceSrc = (int) ((picSrc.getWidth() - picSrc.getImageWidth())
  					* scaleX + 0.5);
  			int spaceTrg = picTrg.getWidth() - wNew;
  			xOfs += (spaceTrg - spaceSrc) / 2;
  			if (xOfs < 0) {
  				xOfs = 0;
  			} else if (xOfs + wNew > picTrg.getWidth()) {
  				xOfs = picTrg.getWidth() - wNew;
  			}
  			picTrg.setOfsX(xOfs);
  		}
  		if (hNew != hOld) {
  			int yOfs = (int) (picSrc.getYOffset() * scaleY + 0.5);
  			int spaceSrc = (int) ((picSrc.getHeight() - picSrc.getImageHeight())
  					* scaleY + 0.5);
  			int spaceTrg = picTrg.getHeight() - hNew;
  			yOfs += (spaceTrg - spaceSrc) / 2;
  			if (yOfs + hNew > picTrg.getHeight()) {
  				yOfs = picTrg.getHeight() - hNew;
  			}
  			picTrg.setOfsY(yOfs);
  		}
  		// was image cropped?
  		return (wNew != wOld) || (hNew != hOld);
  	}