Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 06-29-2002, 07:05 PM
wooolF[RM]'s Avatar
wooolF[RM] wooolF[RM] is offline
 
Join Date: Jan 2002
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

]
Code:
<br />
<b>Fatal error</b>:  Call to undefined function:  imagecreatefromjpeg() in <b>/blabla/sig.php</b> on line <b>27</b><br />
where line 27 is
Code:
$im = imagecreatefromjpeg($logos[$logo]);
Reply With Quote
  #12  
Old 06-29-2002, 07:08 PM
wooolF[RM]'s Avatar
wooolF[RM] wooolF[RM] is offline
 
Join Date: Jan 2002
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

]the code I use right now looks like this: (just making sure we are talking about same script and same things)
Code:
<?php
$logodir = "http://www.somewhere.com/pics/";

header('Content-Type: image/jpeg');
header('Content-Disposition: inline; filename=file.jpg');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Pragma: no-cache');

$logos = array
(
    $logodir . "1.jpg",
    $logodir . "2.jpg",
    $logodir . "3.jpg",
    $logodir . "4.jpg",
    $logodir . "5.jpg",
    $logodir . "6.jpg"
);

function make_seed() {
    list($usec, $sec) = explode(' ', microtime());
    return (float) $sec + ((float) $usec * 100000);
}
srand(make_seed());

$logo = rand(0, count ($logos) - 1);

$im = imagecreatefromjpeg($logos[$logo]);
Imagejpeg($im);
imagedestroy($im);

?>
Reply With Quote
  #13  
Old 06-30-2002, 01:10 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, look here:
http://www.php.net/manual/en/functio...tefromjpeg.php

its a standartfunction in php.
something with your php-installation seems not to be ok...
Reply With Quote
  #14  
Old 06-30-2002, 01:28 PM
wooolF[RM]'s Avatar
wooolF[RM] wooolF[RM] is offline
 
Join Date: Jan 2002
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

]I have tried it on 2 servers now... one in Germany and one in Holland. Both are installed by 2 difefrent peoples. Same result - doesn't work
Reply With Quote
  #15  
Old 06-30-2002, 01:34 PM
wooolF[RM]'s Avatar
wooolF[RM] wooolF[RM] is offline
 
Join Date: Jan 2002
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

]by the way... I don't blame you or something... I really appreciatte all your help... but I can't see meaning of creating an image from an EXISTED image, show it and then destroy it...

why not just push the existed image?
Reply With Quote
  #16  
Old 06-30-2002, 01:34 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

have tried it at my server, works perfect:
Reply With Quote
  #17  
Old 06-30-2002, 01:51 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by wooolF[RM]
by the way... I don't blame you or something... I really appreciatte all your help... but I can't see meaning of creating an image from an EXISTED image, show it and then destroy it...
why not just push the existed image?
i don't know why, its just the way php wants it

hmm, maybe your servers have disabled this function, have tested it on another server too and works perfectly too
Reply With Quote
  #18  
Old 06-30-2002, 02:09 PM
wooolF[RM]'s Avatar
wooolF[RM] wooolF[RM] is offline
 
Join Date: Jan 2002
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

]ok... I got my friend to use it on his server (3rd server I'm trying to get it workk on).

It works! yay! now the problem is : all 6 pics I used was 25-30kb in size in perfect quality. After randomizing by this script all I get is blurred, low quality picture 8-9kb in size...

are there any ways to be sure that qulity at the end is the same as in the start?

btw : thanx for this workaround
Reply With Quote
  #19  
Old 06-30-2002, 03:27 PM
wooolF[RM]'s Avatar
wooolF[RM] wooolF[RM] is offline
 
Join Date: Jan 2002
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

]Anyway, here's updated version of my script that should at the output generate progressive JPEG with 100% quality.

Code:
<?php

/* Location of the pictures */
$logodir = "http://www.mpc.turbohost.net/wolfsig/";

/* Type of output (for browsers) */
header('Content-Type: image/jpeg');

/* No caching (for newer browsers) */
header('Cache-Control: no-store, no-cache, must-revalidate');

/* No caching (for older browsers) */
header('Pragma: no-cache');


/* Making an array with all pictures */
$logos = array
(
    $logodir . "1.jpg",
    $logodir . "2.jpg",
    $logodir . "3.jpg",
    $logodir . "4.jpg",
    $logodir . "5.jpg",
    $logodir . "6.jpg"
);


/* explode = explode an array */
/* microtime = return current UNIX timestamp with microseconds */

function make_seed() {
    list($usec, $sec) = explode(' ', microtime());
    return (float) $sec + ((float) $usec * 100000);
}

/* explode	= seed the random number generator */
srand(make_seed());


/* rand = seed the random number generator */
/* count = count elements in a variable */
$logo = rand(0, count ($logos) - 1);

/* Create image from predefined variables */
$im = ImageCreateFromJPEG($logos[$logo]);

/* Output image as a progressive JPEG */
imageinterlace($im,1);

/* Output image with 100% quality */
Imagejpeg($im,'', 100);

/* Destroy picture on the server */
imagedestroy($im);

?>

As always... Script is working but there's some problems with it : generated pictures are not in the same quality as input pictures.
Reply With Quote
  #20  
Old 06-30-2002, 03:47 PM
wooolF[RM]'s Avatar
wooolF[RM] wooolF[RM] is offline
 
Join Date: Jan 2002
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

forget it... I'm using other script
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:18 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04858 seconds
  • Memory Usage 2,262KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete