Someone correct me if I am wrong, but I doubt it.<br><br>I just wrote up a quick script on my PC that MD5&#39;s 1000 40 character strings - it executes in 0.00061 seconds. I need to do about 2 million until the script hits the one second mark.<br>
<br>Unless you are processing an extremely large amount of images, I would say the overhead of calling md5() can be ignored.<br><br>- Frederik<br><br><div class="gmail_quote">2009/9/15 nitin gupta <span dir="ltr">&lt;<a href="mailto:nitingupta.iitg@gmail.com">nitingupta.iitg@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><span style="border-collapse: collapse;"><div>Hi,</div><div><br></div><div>Any webpage contains a lot of images, I am not aware of the time complexity of the function implementation, but won&#39;t it will be an overkill to generate so many md5 hashes?</div>


<div><br></div><div>Looking forward.</div><br>Message: 1<br>Date: Mon, 14 Sep 2009 21:16:12 +0530<br>From: nitin gupta &lt;<a href="mailto:nitingupta.iitg@gmail.com" style="color: rgb(51, 102, 51);" target="_blank">nitingupta.iitg@gmail.com</a>&gt;<br>


Subject: [development] Shortening file names downloaded from webpage<br>To: <a href="mailto:development@drupal.org" style="color: rgb(51, 102, 51);" target="_blank">development@drupal.org</a><br>Message-ID:<br>       &lt;<a href="mailto:4f59ac610909140846x5efff3bai3bc4a5deb5054b37@mail.gmail.com" style="color: rgb(51, 102, 51);" target="_blank">4f59ac610909140846x5efff3bai3bc4a5deb5054b37@mail.gmail.com</a>&gt;<br>


Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<div class="im"><br><br>Hello,<br>I am maintaining a module FeedAPI ImageGrabber. It downloads a relevant<br>image from a webpage of the feed-item and stores it along with the node. I<br>


found that the module sometimes gave the &#39;filename too long error&#39; (<br><a href="http://drupal.org/node/505964" style="color: rgb(51, 102, 51);" target="_blank">http://drupal.org/node/505964</a>). It happens because I was saving the image<br>


file with the name as basename($image_url).<br><br>But to solve the issue, I am now trying this code to shorten the filename.<br><br>$arr = parse_url($image_url);<br>$filename = basename($arr[&#39;path&#39;]);<br><br>This code solves the problem by removing the query and fragments of the url.<br>


Does anyone know of any better way to handle this? Can anyone point out any<br>issues with this code?<br><br>Regards,<br>Nitin Kumar Gupta<br><a href="http://publicmind.in/blog" style="color: rgb(51, 102, 51);" target="_blank">http://publicmind.in/blog</a><br>
</div>

-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: &lt;<a href="http://lists.drupal.org/pipermail/development/attachments/20090914/1269e63c/attachment-0001.htm" style="color: rgb(51, 102, 51);" target="_blank">http://lists.drupal.org/pipermail/development/attachments/20090914/1269e63c/attachment-0001.htm</a>&gt;<br>


<br>------------------------------<br><br>Message: 2<br>Date: Mon, 14 Sep 2009 17:12:40 +0100<br>From: Stewart Robinson &lt;<a href="mailto:stewsnooze@gmail.com" style="color: rgb(51, 102, 51);" target="_blank">stewsnooze@gmail.com</a>&gt;<br>


Subject: Re: [development] Shortening file names downloaded from<br>       webpage<br>To: <a href="mailto:development@drupal.org" style="color: rgb(51, 102, 51);" target="_blank">development@drupal.org</a><br>Message-ID:<br>
       &lt;<a href="mailto:b84e952a0909140912v339b22e1s395357c6cbad792b@mail.gmail.com" style="color: rgb(51, 102, 51);" target="_blank">b84e952a0909140912v339b22e1s395357c6cbad792b@mail.gmail.com</a>&gt;<br>

Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<div class="im"><br><br>Why not just md5() the full URL and store that instead.<br>i.e.<br><br>$filename = md5($arr[&#39;path&#39;]);</div></span><div><span style="border-collapse: collapse;"><br>


</span></div><div><span style="border-collapse: collapse;">--<br clear="all"></span><div class="im">Regards,<br>Nitin Kumar Gupta<br><a href="http://publicmind.in/blog" target="_blank">http://publicmind.in/blog</a><br>
</div></div>
</blockquote></div><br>