Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sathishIPL

Pages: 1 [2] 3 4
16
Hi All,

The gif resizer class was not written by me.

It was taken from here
http://www.phpclasses.org/package/7353-PHP-Resize-animations-in-files-of-the-GIF-format.html.

I have just integrated into the 4images.

Goto Includes/image_utils.php

find the function resize_image_gd

function resize_image_gd($src$dest$quality$width$height$image_info) {
  global 
$convert_options;

  
$types = array(=> "gif"=> "jpeg"=> "png");
  if (
$convert_options['convert_gd2']) {
    
$thumb imagecreatetruecolor($width$height);
  }
  else {
    
$thumb imagecreate($width$height);
  }
  
$image_create_handle "imagecreatefrom".$types[$image_info[2]];
  if (
$image $image_create_handle($src)) {
    if (
$convert_options['convert_gd2']) {
      
imagecopyresampled($thumb$image0000$width$heightImageSX($image), ImageSY($image));
    }
    else {
      
imagecopyresized($thumb$image0000$width$heightImageSX($image), ImageSY($image));
    }

    if (
$image_info[2] == 3) {
      
$quality 9;
    }

    
$image_handle "image".$types[$image_info[2]];
    
$image_handle($thumb$dest$quality);
    
imagedestroy($image);
    
imagedestroy($thumb);
  }
  return (
file_exists($dest)) ? 0;
}


Replace with the below code


function resize_image_gd($src$dest$quality$width$height$image_info) {
  global 
$convert_options;

  
$types = array(=> "gif"=> "jpeg"=> "png");
  if(
$types[$image_info[2]]=="gif"){
	
//require_once "gifresizer.php";
	
//Including our class
	
require(
ROOT_PATH.'includes/gifresizer.php');
	
$gr = new gifresizer;
	
//New Instance Of GIFResizer
	
$gr->temp_dir THUMB_TEMP_PATH//Used for extracting GIF Animation Frames
	
$gr->resize($src,$dest,$width,$height); //Resizing the animation into a new file.
  
}
  else{
  if (
$convert_options['convert_gd2']) {
    
$thumb imagecreatetruecolor($width$height);
  }
  else {
    
$thumb imagecreate($width$height);
  }
  
  
$image_create_handle "imagecreatefrom".$types[$image_info[2]];
  if (
$image $image_create_handle($src)) {
    if (
$convert_options['convert_gd2']) {
      
imagecopyresampled($thumb$image0000$width$heightImageSX($image), ImageSY($image));
    }
    else {
      
imagecopyresized($thumb$image0000$width$heightImageSX($image), ImageSY($image));
    }

    if (
$image_info[2] == 3) {
      
$quality 9;
    }

    
$image_handle "image".$types[$image_info[2]];
    
$image_handle($thumb$dest$quality);
    
imagedestroy($image);
    
imagedestroy($thumb);
  }
  }
  return (
file_exists($dest)) ? 0;
}


and download the gifresizer.php

Upload into the yourdomain/includes/gifresizer.php

It will resize your Gif Images without loss of animations.

Br,
Satz


17
Hi,

Yes, it will affect until if you add those keywords into the header section.

More keywords ,more traffic from google.

you can analyize about keywords in google webmaster tool

Br,
Satz

18
Hi ,

By using regex function, we can remove it


goto session.php in function get_image_url()

find
  $row['image_name'] = fixname($row['image_name']);

replace with below code.

  $row['image_name'] = preg_replace("#[-_'`´\^\$\(\)<>\"\|,@\?%~\+\.\[\]{}:\/=!§\\\\]+#s","-",fixname($row['image_name']));

it will replace ( with -

Hope it will helps you ..I didnt test it.   It's a 4images native regex

19
Mods & Plugins (Requests & Discussions) / Re: fancybox integration
« on: February 15, 2012, 06:06:47 AM »
Hi All,

I am trying to resize an image with aspect ration by using the below function .

Which was posted in Fancybox Integration

http://www.4homepages.de/forum/index.php?topic=29394.0

function imag_size($width_orig,$height_orig){
  
$width 600;//max width to resize the image
  
$height 650;//max height to resize the image
	
if(
$width<$width_orig || $height<$height_orig){
	
   
$ratio_orig $width_orig/$height_orig;

	
if (
$width/$height $ratio_orig) {
	
   
$width $height*$ratio_orig;
	
} else {
       
$height $width/$ratio_orig;
	
}
	
return 
'width="'.ceil($width).'" height="'.ceil($height).'"';}
}



The issue i am facing is , some times the image is not re sized and it is displaying the original image.

when i checked the source code of the page, there was no width and height specified in the image.

I have cleared the cache , session and everything.

Can anyone know have faced the problem before?

I am tired of finding the root cause.

Thank You...!

Br,
satz


20
HI Budduke,

I was out of town.

It is working without any issues when other users logged using Facebook account.

Only the logout issue  is happening , when i login.

Thank You...!

Best regards,
Satz

21
Hi Duke,

I have implemented the mod.

Thanks for wonderful mod.

everything works fine for me .Except when i logout , am able to logout from facebook.

But not from the 4images.

Its different one .
Are you using GRAPH API to connect?

 I am currently developing Upload a photo to Facebook. It is not redirecting to the current URL in Firefox.

Here is the logic -> A upload Facebook submit button will be placed under the images- when a user click the upload Facebook button -> it will check for two things

1.If Valid FB session - the Images will be uploaded to user photo albums
2.If not it will be redirect to Facebook login page-> once the user login again he/she will be redirected to particular action called upload Facebook[here it is not redirected to correctly to the action]

Thank You...!

best regards,
Satz


22
Hi,

currently am testing microformats.

It is working for me and need to tweak the code for dynamic changes.

Here is the sample preview currently tested in rich snippets in testing tool.

Once i modify everything i will post a tutorial here.

see the attached image when i tested in google rich snippets tool

23
Thanks Mr.Andrew.

Here is a another tweak for this mod.

display image or ads[google adsense] instead of spinner.gif.

go to templates/your templates/style.css and remove the below css
 #loader.loading {
            
backgroundurl('images/spinner.gif'no-repeat center center;
        }


go to templates/your templates/details.html and find the code
<div id="loader" class="loading">

</
div>


replace with  below code ..Here we are creating a div class loading and it will be removed after the image is loader
<div id="loader">
<
div class="loading">

 
Place your HTML code here........
</
div>

</
div>




and finally we will change  our Jquery

and replace the original step 1.1 with below code
<script language="javascript" type="text/javascript">
// when the DOM is ready
// when the DOM is ready
$(function () {
  var 
img = new Image();
  
  
// wrap our new image in jQuery, then:
  
$(img)
    
// once the image has loaded, execute this code
    
.load(function () {
      
// set the image hidden by default    
      
$(this).hide();
       
// with the holding div #loader, apply:
     
$('.loading').remove();
        
// remove the loading class (which contains HTML,i.e ads), 
     
        // then insert our image
        
$('#loader').append(this);
    
      
// fade our image in to create a nice effect
      
$(this).fadeIn();
    })
    
    
// if there was an error loading the image, react accordingly
    
.error(function () {
      
// notify the user that the image could not be loaded
    
})
    
    
// *finally*, set the src attribute of the new image to our image
    
.attr({
src:'{media_src}',
alt:'{image_name}',
title:'{image_name}'});
});

</
script>


DEMO again :: http://satz.0fees.net/details.php?image_id=1

24
Hi ,

I have a simple clarification here.

The re size of an image will be created on the fly.

Is the re sized image will be remain  in the big folder? and it wont be deleted after the download.

Thank You...!

Br,
satz


25
Hi All,

This is my second MOD.

Hope i will contribute to 4images what am learning here.

DEMO::: http://satz.0fees.net/details.php?image_id=1


Please follow the below steps
step 1 : open templates/your templates/header.tml and insert the below code  after <head> section
<script src="./js/jquery.js" type="text/javascript"></script>


Step 1.1 : open templates/your templates/header.html  and insert  below code before </head> section

<script language="javascript" type="text/javascript">
// when the DOM is ready
$(function () {
  var 
img = new Image();
  
  
// wrap our new image in jQuery, then:
  
$(img)
    
// once the image has loaded, execute this code
    
.load(function () {
      
// set the image hidden by default    
      
$(this).hide();
    
      
// with the holding div #loader, apply:
      
$('#loader')
        
// remove the loading class (so no background spinner), 
        
.removeClass('loading')
        
// then insert our image
        
.append(this);
    
      
// fade our image in to create a nice effect
      
$(this).fadeIn();
    })
    
    
// if there was an error loading the image, react accordingly
    
.error(function () {
      
// notify the user that the image could not be loaded
    
})
    
    
// *finally*, set the src attribute of the new image to our image
    
.attr({
src:'{media_src}'
,alt:'{image_name}',
title:'{image_name}'});
 
});

</
script>


step 2: open templates\your templates\details.html  and find {image}

replce with below code
<div id="loader" class="loading">



</
div>



Step 3: open templates/your templates/style.css and add the below code at the end.
 #loader {
               
displayblock;
	
	
	
padding:8px;
	
	
	
border:solid;
	
	
	
border-color#dddddd #aaaaaa #aaaaaa #dddddd;
	
	
	
border-width1px 2px 2px 1px;
	
	
	
background-color:white;

        }

        
#loader.loading {
            
backgroundurl('images/spinner.gif'no-repeat center center;
        }



upload the spinner.gif into templates/your templates/images

create a new folder called Js in your domain root and upload the jquery.js into the js folder.
Additionally you can create a loader gif image in
 http://www.ajaxload.info/





26
Discussion & Troubleshooting / Microformats- search Engines RDF,MICROFORMAT
« on: December 22, 2011, 09:26:26 AM »
Hi all,

Have any one used hreview in Microformats?

It will used in 4images to display the ratings and votes while searching in google or yahoo or bing.

I have tried but am not able to complete it.

Does any one used or link to good tutorials? I have read google tutorial , but its vague and not able to understand it completely.

Thank you...!

Best Regards,
Satz

27
Discussion & Troubleshooting / Protect Images using PHP and .htaccess
« on: December 06, 2011, 02:20:34 PM »
Hi All,

How to protect a images in the folder?

for example anyone who knows 4images structure can access the exact image URL path to store the image

http://yourdomain/data/1/someimage.jpg

by typing the above image url ,user can download the images.

I know its not possible to protect the images in web directories 100%.

but by using php and .htaccess ,we can protect 90%.


Please guide me.


Thank you...!

br,
Satz

28
I think Jquery selectors is conflicting with other Javacscript framework  i.e yahoo libraries

I am not 100% sure will this code work or not .But just give a try

I didnt test the CODE

please replace the below jquery code in Imageoverlay text[mod].

<script type="text/javascript">
$.
noConflict();
jQuery(window).load(function(){
	
//for each description div...
	
jQuery('div.description').each(function(){
	
	
//...set the opacity to 0...
	
	
jQuery(this).css('opacity'0);
	
	
//..set width same as the image...
	
	
jQuery(this).css('width'jQuery(this).siblings('img').width());
	
	
//...get the parent (the wrapper) and set it's width same as the image width... '
	
	
jQuery(this).parent().css('width'jQuery(this).siblings('img').width());
	
	
//...set the display to block
	
	
jQuery(this).css('display''block');
	
});
	

	
jQuery('div.wrapper').hover(function(){
	
	
//when mouse hover over the wrapper div
	
	
//get it's children elements with class descriptio
	
	
//and show it using fadeTo
	
	
jQuery(this).children('.description').stop().fadeTo(5000.7);
	
},function(){
	
	
//when mouse out of the wrapper div
	
	
//use fadeTo to hide the div
	
	
jQuery(this).children('.description').stop().fadeTo(5000);
	
});
	

});
</
script>

29
Discussion & Troubleshooting / Re: IPTC and Exif are not displayed
« on: November 15, 2011, 01:45:16 PM »
Hi,

I found the root cause here.

The metadata(exif and IPTC) are not copied while resizing a original image. It means a new image is created with different size.

So the metadata of the image is destroyed.

Probably have to use the IPTCembed fucntion to copy the metdata into newly created image.

Let me try out this.

Best Regards,
satz

30
Discussion & Troubleshooting / Re: IPTC and Exif are not displayed
« on: November 14, 2011, 03:32:44 PM »
Hi,

I have noticed that, if the original image resized then the IPTC and EXIF data are not visible.

It means ,the data will be avalibale only for original image

Thanks

Br,
satz

Pages: 1 [2] 3 4