Image Crud thumbnails display error - image

Im using IMAGE CRUD to handle a images gallery, upload is correct, insert into table is correct but displaying thumnbails images is wrong, this is an example of the url for image thumbnails that IMAGE CRUD generates:
<img src="http://localhost/macoutlet/http://localhost/macoutlet/assets/uploads/thumb__http://localhost/macoutlet/http://localhost/macoutlet/assets/uploads/673d7-kim-kardashian-gingerly.jpg" class="basic-image" height="60" width="90">
Does anyone know the reason or how can fix this?

Dont know the reason, maybe because of htaccess rewrite or similar.
Fix: in file /application/libraries/image_crud.php around line 373 find this line:
$results[$num]->thumbnail_url = base_url().$this->image_path.'/'.$this->thumbnail_prefix.$row->{$this->url_field};
and replace with:
$thumbUrlBugFix = explode('/', $row->{$this->url_field});
$results[$num]->thumbnail_url = base_url().$this->image_path.'/'.$this->thumbnail_prefix.end($thumbUrlBugFix);

Related

How to insert a quickchart.io api generated image into laravel dompdf

I want to use https://quickchart.io/ API to generate chart images and I want to insert them into a Laravel PDF report created with barryvdh/laravel-dompdf. I am creating the URL for the quickchart.io API and it works correctly, if I put it in the browser's address bar the image of the chart is returned just fine. But I can't insert it into the PDF report because I get this error: "Image not found or type unknown". And that is quite understandable because the URL doesn't simply contain an image name like "my-image.png". I am trying to use this markup in the PDF view: <img src="{{ $ga_UsersCpcChartUrl }}" alt="google analytics chart">. I already set the line: "enable_remote" => true inside the dompdf config file. What shall I do to fix this?
One simple way to work around this is to add a URL parameter to the end of the QuickChart URL that identifies it as an image.
<img src="{{ $ga_UsersCpcChartUrl }}&f=.png"
This will help programs that rely on file extension.
If that doesn't work, I'd probably have to see your $ga_UsersCpcChartUrl to help debug further.

Drupal 7 image_style_url not creating the styled image

I have the following codes to test the image_style_url() on the latest drupal(v7.59)
<img src=“<?= file_create_url($fileuri); ?>” />
<img src=“<?= image_style_url(“medium”, $fileuri); ?>” />
The file_create_url() can show the original image properly, and the image_style_url() can only give the styled image url, but not creating any styled image in the styled image folder.
the public:// and the /tmp directriea are in 777 permission setting, so it won’t be related to permission problem.
Can someone tell me what is wrong with my drupal?
Seems you have to create the image derivate first. Normally this happens automatically when uploading an image via an image field upload. But the automatic derivate creating might simply get skipped on file field uploads, or when using some other image which isn't managed by Drupal at all, or when you added an image style after you already uploaded the image.
Have a look at image_style_create_derivative($style, $source, $destination). Check out the comments as well as $style needs to be an array returned by image_style_load('MYSTYLE').
Creates a new image derivative based on an image style.
Only issue left open is how to check first if the derivate already exists before calling that function. Maybe you can check what file_exists(image_style_path($style_name, $file_uri)) returns, first.
Read more: https://drupal.stackexchange.com/a/22555/15055
Nothing wrong with your Drupal. Derivative image is not physically created until someone visits the listing where that style is used.
Example: You create new node and upload an image on it. Original image is within files folder. But if you use for example teaser image style and if you go to teaser folder the image is not created there until someone visits the page where "teaser" image style is used. You can easily test this on clean Drupal. Basically the image is created on the fly on HTTP request.

How to create dummy image

I have seen many themes or scripts in which people use dummy images in places of image as shown in here :-
Dummy Image
and when i check its url , its like data:image/64 svg image something like this format , so how to create such images for our project?
I want offline method to get such images which can work offline aswell.
I searched alot for the solution but unable to find any solution for it so far , i got the php gd method but i wanted to know how it can be done as data:image method
try : lorempixel
if you want a 500 x 500 image
<img src="http://lorempixel.com/500/500" />
you can even specify the theme like :
<img src="http://lorempixel.com/500/500/nature" />
Base 64 svg seems to be some kind of format that optimizes your images. You can read about it here:
Base64 - Wikipedia
And you can use the following website to optimize your images with the Base64 encoding:
b64.io

Can not insert images inline OpenWYSIWYG with CodeIgniter

My previous question was here
missing images OpenWYSIWYG editor , Code igniter Structure.
I was able to load icon images and can upload image, but I can't insert image into inline text:
Please see the images for a clearer picture. It just won't add them to the textarea.
Modified 1-6-2013
After fixing
assets/js/openwysiwyg/addons/imagelibrary/insert_image.php.
I was able to add image frame
how ever URL enter is wrong
URL should be
app_name/assets/js/openwysiwyg/uploads
How can I fixed that?
I fixed it , by the solution from this link
http://www.ussamerica.org/Scripts/openwysiwyg_v1.4.7/docs/addons.html
after changing
/assets/js/openwysiwyg/addons/imagelibrary/config.inc.php
like this it works now
$imagebaseurl = '/app_name/assets/js/openwysiwyg/uploads/';
I am posting this as it might helpful to someone in the future.

How to display QR code url image into pdf file?

Hey I have this textarea that makes the text into pdf when I press generate.
And now I want a qr code img to get added. The problem is the pdf can't detect it, but only make space for it.
Example if I add a img like:
<img src="http://upload.wikimedia.org/wikipedia/commons/b/b6/Image_created_with_a_mobile_phone.png"/>
it works.
But if I add something like
<img src="http://chart.apis.google.com/chart?chf=a,s,000000|bg,s,FFFFFF&chs=300x300&chld=M|4&cht=qr&chl=++++++++++++++++++++++++++++test%0A++++++++++++++++++++++&choe=UTF-8"/>
It wont work
Any ideas how I can make this work?
I think you should download it first into local disk, then you could write local address of that image in 'src='.
img src="http://localhost/blabla/image/chart.png"/>
Maybe its because your url isnt image, but php page. So pdf converter couldnt display it in to pdf.

Resources