Adds a photo to a set.

@return true on success

@param $photo a ComPhotosDomainEntityPhoto object
352547
public function addPhoto($photo)
    {
        $photos = AnHelperArray::getIterator($photo);

        foreach ($photos as $photo) {
            if (!$this->photos->find($photo)) {
                $this->photos->insert($photo, array(
                     'author' => $photo->author,
                ));
            }
        }
    }
396527
public function applyToImage(Image $image, $x = 0, $y = 0)
    {
        $background = new Color($this->background);
        imagefilledrectangle($image->getCore(), $this->x1, $this->y1, $this->x2, $this->y2, $background->getInt());

        if ($this->hasBorder()) {
            $border_color = new Color($this->border_color);
            imagesetthickness($image->getCore(), $this->border_width);
            imagerectangle($image->getCore(), $this->x1, $this->y1, $this->x2, $this->y2, $border_color->getInt());
        }

        return true;
    }
267524
public function apply(Picture $picture)
    {
        if($picture->isGd())
        {
            $resource = $this->resizeGd($picture->getResource());

            $picture->setResource($resource);
        }
        else
        {
            $this->resizeImagick($picture->getResource(), $picture);
        }
    }
1086206
public function addImageFromString($image) {
        if (empty($image)) {
            throw new InvalidArgumentException('Specified image is empty');
        }

        return $this->getCommand('AddImage', array(
            'user' => $this->getUser(),
            'image' => $image,
        ))->execute();
    }
372196
public function addColor($color)
    {
        if ( ! $color instanceof Color ) {
            $color = new Color($color);
        }

        $this->colors []= $color;
    }
1279312
public function isImage($file){
        $ext = $file->getExtension();
        if(in_array(strtolower($ext), $this->config["images"]["images_ext"] ) )
            return true;
        else
            return false;
    }
264603
public function addToIdentity($array)
    {
        if ($this->instance instanceof \Phavour\Session\Storage) {
            if ($this->instance->isLocked()) {
                $this->instance->unlock();
            }
            $temp = $this->instance->get('identity');
            if (!$temp) {
                $temp = array();
            }
            $newIdentity = array_merge($temp, $array);
            $this->instance->set('identity', $newIdentity);
            $this->instance->lock();
            return true;
        }

        return false;
    }
377515
def favorites_add(photo_id):
    """"""
    method = 'flickr.favorites.add'
    _dopost(method, auth=True, photo_id=photo_id)
    return True
1105735
def attach_photo(self, photo: String, caption: String = None):
        
        self.media.attach_photo(photo, caption)
        return self
1276418
public function setImage($image)
    {
        $this->image = base64_encode($image);

        // create temp file
        $this->tempPath = sys_get_temp_dir() . '/' . uniqid('ladybug_');
        file_put_contents($this->tempPath, $image);
    }
1028422
public void addPhoto(Photo photo) {
        Photo.PhotoType type = photo.getType();
        if (postType != null && !postType.equals(type)) {
            throw new IllegalArgumentException("Photos must all be the same type (source or data)");
        }
        if (pendingPhotos == null) {
            pendingPhotos = new ArrayList<Photo>();
        }
        pendingPhotos.add(photo);
        this.postType = type;
    }
531671
def addPhoto(self, photo):
        
        method = 'flickr.photosets.addPhoto'

        _dopost(method, auth=True, photoset_id=self.id, photo_id=photo.id)

        self.__count += 1
        return True
690824
public function addImageSet($postValues)
    {
        $imageSetObject = ImageSetFactory::createImageSetFromPostValues($postValues);

        $imageSet = $this->repository->imageSet;
        $imageSet[] = $imageSetObject;
        $this->repository->imageSet = $imageSet;

        $this->save();
    }
146925
public function addImage(Image $image)
    {
        // Find the image based on UUID inside the internal state.
        $existingImage = $this->images->findImageByUUID($image->getMediaObjectId());

        if ($existingImage === null) {
            $this->apply(
                $this->createImageAddedEvent($image)
            );
        }
    }
402705
public function apply(Picture $picture)
    {
        $resource = $picture->getResource();

        if($picture->isGd())
        {
            $resource = $this->applyWatermarkGD($resource, $picture);

            $picture->setResource($resource);
        }
        else
        {
            $this->applyWatermarkImagick($resource);
        }
    }
1075899
public function apply(Picture $picture)
    {
        if($picture->isGd() || $picture->gdAvailable())
        {
            $resource = $picture->getResource($picture::WORKER_GD);

            imagefilter($resource, IMG_FILTER_MEAN_REMOVAL);
            imagefilter($resource, IMG_FILTER_CONTRAST, -50);

            $picture->setResource($resource);
        }
        else
        {
            // MOSAIC IS NOT SUPPORTED IN IMAGICK
        }
    }
200163
def put_photo(self, image, album_path="me/photos", **kwargs):
        
        return self.request(
            "{0}/{1}".format(self.version, album_path),
            post_args=kwargs,
            files={"source": image},
            method="POST",
        )