Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Hello,


I do not know what is happening, but I do upload images that are not being cut. Here is my code:


Code: Select all
<cms:template title='Portifólio' clonable='1' dynamic_folders='1' gallery='1'>
   <cms:editable
      name="gg_image"
      label="Imagem"
      show_preview='1'
      preview_height='200'
      height='500'
      width='500'
      crop='1'
      type="image"
   />
   <cms:editable
      name="gg_thumb"
      assoc_field="gg_image"
      label="Miniatura"
      width='186'
      height='99'
      crop='1'
      type="thumbnail"
   /> 



Did I do something wrong?
Hi,

Have you, by any chance, chosen to extract EXIF data from the uploaded images?
// 25
// Set the following to '1' if you wish to extract EXIF data from images uploaded to Gallery
define( 'K_EXTRACT_EXIF_DATA', 1 );

If this is so, as is documented on the Photo Gallery page, Couch will not modify the uploaded images in any manner (which includes cropping) because doing so will result in losing EXIF data permanently from the images. Following is an excerpt from the documentation
A note of caution here:

The GD library used on the server side (by Couch as well as most other scripts) for image manipulation has the property of discarding away the Exif data for good from the image being manipulated (resized for example).

As such, once the you turn on the setting to capture Exif data from images, Couch will NOT resize the uploaded images at all.
This is to keep the exif data within the image intact.
Please remember that with this setting on, you'll have to upload the images already resized on your local machine using any Exif savvy program (like IrfanView).

If this is not possible for the client, a workaround could be to define a new thumbnail associated with the main image that has the proper dimension. The original image will be left untouched however the thumbnail can now be used instead of the original image itself.

The workaround, as mentioned in the excerpt above, is to define an additional 'thumbnail' region and use it place of the uploaded image.

Does this help? Please let me know.
Thanks.
Is not configured to preserve the EXIF.

I put another thumbnail, but it did not work, the code follows:

Code: Select all
<cms:template title='Portifólio' clonable='1' dynamic_folders='1' gallery='1'>
   <cms:editable
      name="gg_image"
      label="Imagem"
      show_preview='1'
      preview_height='200'
      height='500'
      width='500'
      crop='1'
      type="image"
   />
   <cms:editable
      name="gg_thumb"
      assoc_field="gg_image"
      label="Miniatura"
      width='186'
      height='99'
      crop='1'
      type="thumbnail"
   /> 
   <cms:editable
      name="gg_thumb2"
      assoc_field="gg_image"
      label="Miniatura"
      width='500'
      height='500'
      type="thumbnail"
   />
OK. That is straight-forward code that works everywhere and so should work on your system too. Maybe there is some memory allocation issue or something with the GD library.

Can you give me access to your server please? Perhaps I'd be able to spot what is going wrong.
Thanks.
Hi and thank you for granting me access to your site.

I logged into your server and used a new template for testing (name 'test.php').
I put in the exact code you gave me
Code: Select all
<cms:template clonable='1' dynamic_folders='1' gallery='1'>
   <cms:editable
      name="gg_image"
      label="Imagem"
      show_preview='1'
      preview_height='200'
      height='500'
      width='500'
      crop='1'
      type="image"
   />
   <cms:editable
      name="gg_thumb"
      assoc_field="gg_image"
      label="Miniatura"
      width='186'
      height='99'
      type="thumbnail"
   /> 
</cms:template>

I tested it by uploading two images of different dimensions and, as far as I can see, both of them got properly cropped to 500x500.
You can login into the admin and verify this. Try uploading new images to test.php and they should get cropped too.

So, I was unable to recreate the problem you mentioned on the very system you are using.
Please check once again the code that you are using in your problem template and make sure to be logged-in as super-admin (not plain admin) and visit the template on the front-end to persist the changes.
I tested the template test.php and it worked. I decided to remove the EXIF data of the images and he cut right. Thereafter, even with the EXIF images are now cut.

Thanks for the help.
I have the same problem, crop just isn't working at me.

Code: Select all
   <cms:editable 
      name='gg_image2'
      label='Image'
      desc='Upload your main image here'
      crop="1"
      height='320'
      show_preview='1'
      preview_width='150'
      type='image'
   />
7 posts Page 1 of 1
cron