Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Graphical browser with different jpg files names (Read 3643 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Graphical browser with different jpg files names

Hi to everyone, i have a little doubt with the graphical browser, the default setting read only the filed named cover.*, of course in my library there are many other covers with different names.
How i can do to make read the other names?

Code: [Select]
//cover sources, if you add more sources please add more $draw_image functions below
$puts(cpath1,$replace(%path%,%filename_ext%,folder.*))
$puts(cpath2,$replace(%path%,%directory%\%filename_ext%,folder.*))


i tryied with:
Code: [Select]
//cover sources, if you add more sources please add more $draw_image functions below
$puts(cpath1,$replace(%path%,%filename_ext%,*))
$puts(cpath2,$replace(%path%,%directory%\%filename_ext%,*))

but of course read a rando image on the path folder
Any suggestion??

Graphical browser with different jpg files names

Reply #1
as mentioned in the comments of your code above, you need multiple $draw_image statements....

Code: [Select]
$draw_image(4,4,$sub(%gb_width%,5),$sub(%gb_height%,5),$directory_path(%path%)\cover.jpg)
$draw_image(4,4,$sub(%gb_width%,5),$sub(%gb_height%,5),$directory_path(%path%)\folder.jpg)


just remember that if there are multiple images, one will get drawn over the top of the other so any preference you have should go last in the list.

Graphical browser with different jpg files names

Reply #2
as mentioned in the comments of your code above, you need multiple $draw_image statements....

Code: [Select]
$draw_image(4,4,$sub(%gb_width%,5),$sub(%gb_height%,5),$directory_path(%path%)\cover.jpg)
$draw_image(4,4,$sub(%gb_width%,5),$sub(%gb_height%,5),$directory_path(%path%)\folder.jpg)


just remember that if there are multiple images, one will get drawn over the top of the other so any preference you have should go last in the list.


is the same thing, some cover are showed and some not

Graphical browser with different jpg files names

Reply #3
what exactly are you saying? the filenames match the pattern but aren't showing? or you haven't accounted for all the different filenames? if i was you i'd find and rename them all to something universal.

 

Graphical browser with different jpg files names

Reply #4
what exactly are you saying? the filenames match the pattern but aren't showing? or you haven't accounted for all the different filenames? if i was you i'd find and rename them all to something universal.


I've find the solutizion adding these lines to the default code:

Quote
//cover sources, if you add more sources please add more $draw_image functions below
$puts(cpath1,$replace(%path%,%filename_ext%,*cover*.*))
$puts(cpath2,$replace(%path%,%filename_ext%,*folder*.*))
$puts(cpath3,$replace(%path%,%filename_ext%,*front*.*))

//$puts(cpath2,$replace(%path%,%directory%\%filename_ext%,*))

//no cover source, remember to change this if needed
$puts(nocover,components\default.png)

//other image sources
$puts(glareImage,components\glareyo0.png)
$puts(playIcon,components\Play-icon256-by-nagaya.png)

//frame drawing
$if(%gb_focused%,
$set_pen(255-128-0)
$set_brush(255-128-0)
$puts(frameD,$eval(%gb_height%-6))
$round_rect(3,3,$get(frameD),$get(frameD),3,3),
$set_pen(0-0-0)
$set_brush(0-0-0)
$puts(frameD,$eval(%gb_height%-8))
$round_rect(4,4,$get(frameD),$get(frameD),3,3)
)

$puts(coverD,$eval(%gb_height%-12))
//add more cover sources here
$if3(
$draw_image(6,6,$get(coverD),$get(coverD),$get(cpath1),255,nokeepaspect),
$draw_image(6,6,$get(coverD),$get(coverD),$get(cpath2),255,nokeepaspect),
$draw_image(6,6,$get(coverD),$get(coverD),$get(cpath3),255,nokeepaspect),


$draw_image(6,6,$get(coverD),$get(coverD),$get(nocover),255,nokeepaspect)
$put(isNoCover,1)
)

//glare and isplaying images
$draw_image(6,6,$get(coverD),$get(coverD),$get(glareImage),50,nokeepaspect)
$if(%gb_isplaying%,
$draw_image(6,6,$get(coverD),$get(coverD),$get(playIcon),128)
)

$if($get(isNoCover),
$gp_set_font(Tahoma,9,b)
$gp_set_pen(255-0-0-0,2,,round)
$gp_set_brush(255-255-255-255)
$gp_set_string_format(center,center)
$gp_set_smoothing_mode(1)
$gp_draw_string_path(%gb_group%,14,,6,6,$get(coverD),$get(coverD))
)

$if(%gb_mouse_over%,
$gp_set_brush(128-255-255-255,0,0,0-255-255-255,%gb_width%,%gb_height%)
$gp_fill_rectangle(0,0,%gb_width%,%gb_height%)
)