how can i get images from GAE cropped and resized php ?

75 views
Skip to first unread message

mohamed hassan

unread,
Jun 3, 2015, 6:34:39 AM6/3/15
to google-a...@googlegroups.com
Please i downloaded google-api-PHP-client from GitHub from this link ( https://github.com/google/google-api-php-client ) but i want to know how can i get images from my buckets resized or cropped using php code or should i use any other tool ? please provide me with an example to do that

Thanks .

Ryan (Cloud Platform Support)

unread,
Jun 3, 2015, 9:19:21 AM6/3/15
to google-a...@googlegroups.com, mohamedh...@gmail.com
Salutations Mohamed,

I would check out this page on serving an image and this page for options. If you run into issues I would recommend posting on StackOverflow. You should post what you have done and what error you receive. I would read this post first on how to ask a good question. We do monitor GCP tags on StackOverflow.

mohamed hassan

unread,
Jun 3, 2015, 11:36:52 AM6/3/15
to google-a...@googlegroups.com
Salutations Ryan,

I am sorry for not being clarify with you . what i am asking about that can i use the ( google-api-php-client ) library for php to get re-sized or cropped images  and if not i used Google App engine SDK for php and used Cloud Storage Tools class on my locolhost as the following :

$object_image_file = 'gs://zatrek/contact.jpg';
$object_image_url = CloudStorageTools::getImageServingUrl($object_image_file,['size' => 400, 'crop' => true]);
echo $object_image_url;


how can i use this link to get my image cropped ?

Thanks Ryan .

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/RIWoaLlLI9o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/0dc24aad-c5c0-44d2-b04f-16402e33b38b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ryan (Cloud Platform Support)

unread,
Jun 3, 2015, 11:51:02 AM6/3/15
to google-a...@googlegroups.com, mohamedh...@gmail.com
That link will display the cropped image. You can then display it on your website as you would any other image link.


On Wednesday, June 3, 2015 at 11:36:52 AM UTC-4, mohamed hassan wrote:
Salutations Ryan,

I am sorry for not being clarify with you . what i am asking about that can i use the ( google-api-php-client ) library for php to get re-sized or cropped images  and if not i used Google App engine SDK for php and used Cloud Storage Tools class on my locolhost as the following :

$object_image_file = 'gs://zatrek/contact.jpg';
$object_image_url = CloudStorageTools::getImageServingUrl($object_image_file,['size' => 400, 'crop' => true]);
echo $object_image_url;


how can i use this link to get my image cropped ?

Thanks Ryan .
On Wed, Jun 3, 2015 at 4:19 PM, Ryan (Cloud Platform Support) <rbru...@google.com> wrote:
Salutations Mohamed,

I would check out this page on serving an image and this page for options. If you run into issues I would recommend posting on StackOverflow. You should post what you have done and what error you receive. I would read this post first on how to ask a good question. We do monitor GCP tags on StackOverflow.

On Wednesday, June 3, 2015 at 6:34:39 AM UTC-4, mohamed hassan wrote:
Please i downloaded google-api-PHP-client from GitHub from this link ( https://github.com/google/google-api-php-client ) but i want to know how can i get images from my buckets resized or cropped using php code or should i use any other tool ? please provide me with an example to do that

Thanks .

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/RIWoaLlLI9o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.

mohamed hassan

unread,
Jun 3, 2015, 11:56:20 AM6/3/15
to google-a...@googlegroups.com
Salutations Ryan,

I am sorry Ryan i am misunderstand how can display the cropped image from this link ? can you please give me an example how can i execute this ?

Sorry for asking a lot .

Thanks Ryan.

On Wed, Jun 3, 2015 at 6:51 PM, Ryan (Cloud Platform Support) <rbru...@google.com> wrote:
That link will display the cropped image. You can then display it on your website as you would any other image link.


On Wednesday, June 3, 2015 at 11:36:52 AM UTC-4, mohamed hassan wrote:
Salutations Ryan,

I am sorry for not being clarify with you . what i am asking about that can i use the ( google-api-php-client ) library for php to get re-sized or cropped images  and if not i used Google App engine SDK for php and used Cloud Storage Tools class on my locolhost as the following :

$object_image_file = 'gs://zatrek/contact.jpg';
$object_image_url = CloudStorageTools::getImageServingUrl($object_image_file,['size' => 400, 'crop' => true]);
echo $object_image_url;


how can i use this link to get my image cropped ?

Thanks Ryan .
On Wed, Jun 3, 2015 at 4:19 PM, Ryan (Cloud Platform Support) <rbru...@google.com> wrote:
Salutations Mohamed,

I would check out this page on serving an image and this page for options. If you run into issues I would recommend posting on StackOverflow. You should post what you have done and what error you receive. I would read this post first on how to ask a good question. We do monitor GCP tags on StackOverflow.

On Wednesday, June 3, 2015 at 6:34:39 AM UTC-4, mohamed hassan wrote:
Please i downloaded google-api-PHP-client from GitHub from this link ( https://github.com/google/google-api-php-client ) but i want to know how can i get images from my buckets resized or cropped using php code or should i use any other tool ? please provide me with an example to do that

Thanks .

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/RIWoaLlLI9o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/RIWoaLlLI9o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.

Ryan (Cloud Platform Support)

unread,
Jun 3, 2015, 2:01:32 PM6/3/15
to google-a...@googlegroups.com, mohamedh...@gmail.com
You can simply do this: echo "<img src='" . $object_image_url . "' alt='Image'>";

 Note that it will only work from the Production server as your image is hosted on the production server. 
To unsubscribe from this group and all its topics, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/RIWoaLlLI9o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages